Skip to content

Commit

Permalink
Add simpler demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
pomianowski committed Jun 11, 2022
1 parent 7c6150f commit b8db424
Show file tree
Hide file tree
Showing 30 changed files with 355 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Demo/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void ConfigureServices(HostBuilderContext context, IServiceCollection se
services.AddSingleton<IThemeService, ThemeService>();

// Taskbar manipulation
services.AddSingleton<ITaskbarService, TaskbarService>();
services.AddSingleton<ITaskBarService, TaskBarService>();

// Tray icon
// Just in case you wondering, it does not work yet
Expand Down
6 changes: 3 additions & 3 deletions src/Wpf.Ui.Demo/Services/ApplicationHostService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ public class ApplicationHostService : IHostedService
private readonly INavigationService _navigationService;
private readonly IPageService _pageService;
private readonly IThemeService _themeService;
private readonly ITaskbarService _taskbarService;
private readonly ITaskBarService _taskBarService;
private readonly INotifyIconService _notifyIconService;

private INavigationWindow _navigationWindow;

public ApplicationHostService(IServiceProvider serviceProvider, INavigationService navigationService,
IPageService pageService, IThemeService themeService,
ITaskbarService taskbarService, INotifyIconService notifyIconService)
ITaskBarService taskBarService, INotifyIconService notifyIconService)
{
// If you want, you can do something with these services at the beginning of loading the application.
_serviceProvider = serviceProvider;
_navigationService = navigationService;
_pageService = pageService;
_themeService = themeService;
_taskbarService = taskbarService;
_taskBarService = taskBarService;
_notifyIconService = notifyIconService;
}

Expand Down
10 changes: 5 additions & 5 deletions src/Wpf.Ui.Demo/Views/Container.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ public partial class Container : INavigationWindow

private readonly IThemeService _themeService;

private readonly ITaskbarService _taskbarService;
private readonly ITaskBarService _taskBarService;

// NOTICE: In the case of this window, we navigate to the Dashboard after loading with Container.InitializeUi()

public Container(ContainerViewModel viewModel, INavigationService navigationService, IPageService pageService, IThemeService themeService, ITaskbarService taskbarService)
public Container(ContainerViewModel viewModel, INavigationService navigationService, IPageService pageService, IThemeService themeService, ITaskBarService taskBarService)
{
// Attach the theme service
_themeService = themeService;

// Attach the taskbar service
_taskbarService = taskbarService;
_taskBarService = taskBarService;

// Context provided by the service provider.
DataContext = viewModel;
Expand Down Expand Up @@ -105,7 +105,7 @@ private void InvokeSplashScreen()
RootMainGrid.Visibility = Visibility.Collapsed;
RootWelcomeGrid.Visibility = Visibility.Visible;

_taskbarService.SetState(this, TaskBarProgressState.Indeterminate);
_taskBarService.SetState(this, TaskBarProgressState.Indeterminate);

Task.Run(async () =>
{
Expand All @@ -120,7 +120,7 @@ private void InvokeSplashScreen()

Navigate(typeof(Pages.Dashboard));

_taskbarService.SetState(this, TaskBarProgressState.None);
_taskBarService.SetState(this, TaskBarProgressState.None);
});
});
}
Expand Down
10 changes: 5 additions & 5 deletions src/Wpf.Ui.Demo/Views/Pages/Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
Content="WPF UI Button"
Icon="Fluent24" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Button Icon=&quot;Fluent24&quot; Content=&quot;WPF UI Button&quot; /&gt;
&lt;ui:Button Icon=&quot;Fluent24&quot; Content=&quot;WPF UI Button&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand Down Expand Up @@ -100,7 +100,7 @@
Icon="Food24" />
</Grid>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Button Padding=&quot;6&quot; Icon=&quot;Fluent24&quot; Appearance=&quot;Secondary&quot; FontSize=&quot;16&quot; /&gt;
&lt;ui:Button Padding=&quot;6&quot; Icon=&quot;Fluent24&quot; Appearance=&quot;Secondary&quot; FontSize=&quot;16&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand Down Expand Up @@ -166,7 +166,7 @@
Content="Transparent" />
</Grid>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Button Appearance=&quot;Secondary&quot; /&gt;
&lt;ui:Button Appearance=&quot;Secondary&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -183,7 +183,7 @@
Icon="Link48"
NavigateUri="https://www.nuget.org/packages/WPF-UI/" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Hyperlink NavigateUri=&quot;nuget.org/packages/WPF-UI/&quot; Icon=&quot;Link48&quot; /&gt;
&lt;ui:Hyperlink NavigateUri=&quot;nuget.org/packages/WPF-UI/&quot; Icon=&quot;Link48&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -196,7 +196,7 @@
Icon="Link48"
NavigateUri="https://www.nuget.org/packages/WPF-UI/" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Anchor NavigateUri=&quot;nuget.org/packages/WPF-UI/&quot; Icon=&quot;Link48&quot; /&gt;
&lt;ui:Anchor NavigateUri=&quot;nuget.org/packages/WPF-UI/&quot; Icon=&quot;Link48&quot; /&gt;
</ui:CodeBlock>

</VirtualizingStackPanel>
Expand Down
14 changes: 7 additions & 7 deletions src/Wpf.Ui.Demo/Views/Pages/Controls.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</StackPanel>
</ui:CardAction>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:CardAction Icon=&quot;Chat24&quot; /&gt;
&lt;ui:CardAction Icon=&quot;Chat24&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -120,7 +120,7 @@
<ui:ToggleSwitch />
</ui:CardControl>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:CardControl Icon=&quot;Whiteboard24&quot; /&gt;
&lt;ui:CardControl Icon=&quot;Whiteboard24&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -142,7 +142,7 @@
<TextBlock Text="3wiedzmin3najlepszy" />
</ui:CardExpander>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:CardExpander Icon=&quot;PanelLeftExpand20&quot; /&gt;
&lt;ui:CardExpander Icon=&quot;PanelLeftExpand20&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand Down Expand Up @@ -193,7 +193,7 @@
<ui:ProgressRing Grid.Column="1" IsIndeterminate="True" />
</Grid>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:ProgressRing IsIndeterminate=&quot;True&quot; Progress=&quot;80&quot; /&gt;
&lt;ui:ProgressRing IsIndeterminate=&quot;True&quot; Progress=&quot;80&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -209,7 +209,7 @@
HorizontalAlignment="Left"
Content="Rate me" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Rating Content=&quot;Rate me&quot; /&gt;
&lt;ui:Rating Content=&quot;Rate me&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -221,7 +221,7 @@
HorizontalAlignment="Left"
State="None" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:ThumbRate State=&quot;None&quot; /&gt;
&lt;ui:ThumbRate State=&quot;None&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand Down Expand Up @@ -264,7 +264,7 @@
<ui:Badge Appearance="Transparent">Transparent</ui:Badge>
</StackPanel>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:Badge Appearance=&quot;Secondary&quot; Content=&quot;Secondary&quot; /&gt;
&lt;ui:Badge Appearance=&quot;Secondary&quot; Content=&quot;Secondary&quot; /&gt;
</ui:CodeBlock>

</VirtualizingStackPanel>
Expand Down
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Demo/Views/Pages/Data.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
</ItemsControl.ItemTemplate>
</ui:VirtualizingItemsControl>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:VirtualizingItemsControl ItemsSource=&quot;{Binding BrushCollection}&quot; SelectedIndex=&quot;0&quot;/&gt;
&lt;ui:VirtualizingItemsControl ItemsSource=&quot;{Binding BrushCollection}&quot; SelectedIndex=&quot;0&quot;/&gt;
</ui:CodeBlock>

</VirtualizingStackPanel>
Expand Down
20 changes: 10 additions & 10 deletions src/Wpf.Ui.Demo/Views/Pages/Input.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<TextBlock Foreground="{DynamicResource TextFillColorSecondaryBrush}" Text="WPF UI TextBox" />
<ui:TextBox Margin="0,8,0,0" Placeholder="Hello World" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:TextBox Placeholder=&quot;Hello World&quot; /&gt;
&lt;ui:TextBox Placeholder=&quot;Hello World&quot; /&gt;
</ui:CodeBlock>
</StackPanel>
</Grid>
Expand Down Expand Up @@ -88,7 +88,7 @@
Placeholder="Hello World"
TextWrapping="Wrap" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:TextBox MinLines=&quot;3&quot; AcceptsReturn=&quot;True&quot; Placeholder=&quot;Hello World&quot; /&gt;
&lt;ui:TextBox MinLines=&quot;3&quot; AcceptsReturn=&quot;True&quot; Placeholder=&quot;Hello World&quot; /&gt;
</ui:CodeBlock>
</StackPanel>
</Grid>
Expand All @@ -102,7 +102,7 @@
Icon="Fluent24"
Placeholder="Hello World" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:TextBox Icon=&quot;Fluent24&quot; Placeholder=&quot;Hello World&quot; /&gt;
&lt;ui:TextBox Icon=&quot;Fluent24&quot; Placeholder=&quot;Hello World&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -126,7 +126,7 @@
Step="10"
Value="20" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:NumberBox Max=&quot;100&quot; Min=&quot;0&quot; Step=&quot;10&quot; /&gt;
&lt;ui:NumberBox Max=&quot;100&quot; Min=&quot;0&quot; Step=&quot;10&quot; /&gt;
</ui:CodeBlock>
</StackPanel>
<StackPanel Grid.Column="1" Margin="4,0,0,0">
Expand All @@ -142,7 +142,7 @@
Step="0.1"
Value="0.2" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:NumberBox Step=&quot;0.1&quot; DecimalPlaces=&quot;2&quot; IntegersOnly=&quot;False&quot; /&gt;
&lt;ui:NumberBox Step=&quot;0.1&quot; DecimalPlaces=&quot;2&quot; IntegersOnly=&quot;False&quot; /&gt;
</ui:CodeBlock>
</StackPanel>
</Grid>
Expand Down Expand Up @@ -170,7 +170,7 @@
Icon="Fluent24"
Placeholder="Password" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:PasswordBox Icon=&quot;Fluent24&quot; Placeholder=&quot;Password&quot; /&gt;
&lt;ui:PasswordBox Icon=&quot;Fluent24&quot; Placeholder=&quot;Password&quot; /&gt;
</ui:CodeBlock>
</StackPanel>
</Grid>
Expand Down Expand Up @@ -202,7 +202,7 @@
ItemsSource="{Binding ComboCollection, Mode=OneWay}"
SelectedIndex="0" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:ComboBox IsEnabled=&quot;False&quot; /&gt;
&lt;ui:ComboBox IsEnabled=&quot;False&quot; /&gt;
</ui:CodeBlock>
</StackPanel>
</Grid>
Expand All @@ -217,7 +217,7 @@
ItemsSource="{Binding AutoSuggestCollection, Mode=OneWay}"
Placeholder="So you choose Cat, Black Blood or Enhanced Thunderbolt?" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:AutoSuggestBox ItemsSource=&quot;{Binding MyData}&quot; Placeholder=&quot;Search...&quot; /&gt;
&lt;ui:AutoSuggestBox ItemsSource=&quot;{Binding MyData}&quot; Placeholder=&quot;Search...&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand All @@ -230,7 +230,7 @@
ItemsSource="{Binding AutoSuggestCollection, Mode=OneWay}"
Placeholder="So... tell me Snake, what's your name? Your real name?" />
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:SearchBox Placeholder=&quot;So... tell me Snake, what's your name? Your real name?&quot; /&gt;
&lt;ui:SearchBox Placeholder=&quot;So... tell me Snake, what's your name? Your real name?&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand Down Expand Up @@ -376,7 +376,7 @@
IsEnabled="False" />
</Grid>
<ui:CodeBlock Margin="0,8,0,0">
&lt;wpfui:ToggleSwitch IsChecked=&quot;True&quot; /&gt;
&lt;ui:ToggleSwitch IsChecked=&quot;True&quot; /&gt;
</ui:CodeBlock>

<TextBlock
Expand Down
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Demo/Views/Pages/Menus.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</Menu>
<ui:CodeBlock Margin="0,8,0,0">
&lt;Menu&gt;\n
\t&lt;wpfui:MenuItem Header=&quot;With icon&quot; SymbolIcon=&quot;StoreMicrosoft24&quot;&gt;\n
\t&lt;ui:MenuItem Header=&quot;With icon&quot; SymbolIcon=&quot;StoreMicrosoft24&quot;&gt;\n
\t\t&lt;MenuItem Header=&quot;Check&quot; IsCheckable=&quot;True&quot;/&gt;\n
\t&lt;/wpfui:MenuItem&gt;\n
&lt;/Menu&gt;
Expand Down
6 changes: 5 additions & 1 deletion src/Wpf.Ui.Demo/Wpf.Ui.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<UseWPF>true</UseWPF>
<StartupObject>Wpf.Ui.Demo.App</StartupObject>
<ApplicationIcon>mwpf_icon.ico</ApplicationIcon>
<ApplicationIcon>wpfui.ico</ApplicationIcon>
<AssemblyName>WPF UI - Demo App</AssemblyName>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<Version>$(Version)</Version>
Expand Down Expand Up @@ -62,6 +62,10 @@
<None Remove="mwpf_icon.ico" />
</ItemGroup>

<ItemGroup>
<Content Include="wpfui.ico" />
</ItemGroup>

<ItemGroup>
<Resource Include="Resources\fluent-ui-microsoft.png" />
<Resource Include="Resources\geo_icons.png" />
Expand Down
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Demo/app.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="WPFUI.Demo.app"/>
<assemblyIdentity version="1.0.0.0" name="Wpf.Ui.Demo.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
Expand Down
Binary file added src/Wpf.Ui.Demo/wpfui.ico
Binary file not shown.
11 changes: 11 additions & 0 deletions src/Wpf.Ui.SimpleDemo/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Application
x:Class="Wpf.Ui.SimpleDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Wpf.Ui.SimpleDemo"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ui:Resources Theme="Dark" />
</Application.Resources>
</Application>
16 changes: 16 additions & 0 deletions src/Wpf.Ui.SimpleDemo/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using System.Windows;

namespace Wpf.Ui.SimpleDemo;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

10 changes: 10 additions & 0 deletions src/Wpf.Ui.SimpleDemo/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
Loading

0 comments on commit b8db424

Please sign in to comment.