Add another example app
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<UserControl
|
||||
x:Class="KingPing.AnalogOutputCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ScrollViewer Padding="12">
|
||||
<ItemsRepeater ItemTemplate="{Binding TemplateSelector}" Items="{Binding}">
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout
|
||||
ItemsStretch="Uniform"
|
||||
MinColumnSpacing="12"
|
||||
MinItemWidth="200"
|
||||
MinRowSpacing="12"
|
||||
Orientation="Horizontal" />
|
||||
</ItemsRepeater.Layout>
|
||||
</ItemsRepeater>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class AnalogOutputCollectionView : UserControl
|
||||
{
|
||||
public AnalogOutputCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class AnalogOutputCollectionViewModel : ObservableViewModelCollection<AnalogOutputViewModel>
|
||||
{
|
||||
public AnalogOutputCollectionViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
ITemplateSelector templateSelector) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
for(int i = 0; i < 1000; i++)
|
||||
{
|
||||
Add<AnalogOutputViewModel>(Guid.NewGuid().ToString());
|
||||
}
|
||||
TemplateSelector = templateSelector;
|
||||
}
|
||||
|
||||
public ITemplateSelector TemplateSelector { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<SettingsExpander
|
||||
x:Class="KingPing.AnalogOutputView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SettingsExpander.Footer>
|
||||
<ProgressRing />
|
||||
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,17 @@
|
||||
using Avalonia.Styling;
|
||||
using PropertyChanged;
|
||||
using System;
|
||||
using TheXamlGuy.UI.Avalonia.Controls;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class AnalogOutputView : SettingsExpander, IStyleable
|
||||
{
|
||||
public AnalogOutputView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
Type IStyleable.StyleKey => typeof(FluentAvalonia.UI.Controls.SettingsExpander);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class AnalogOutputViewModel : ObservableViewModel
|
||||
{
|
||||
public AnalogOutputViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
string name) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<UserControl
|
||||
x:Class="KingPing.DigitalInputCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
Digital Inputs
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class DigitalInputCollectionView : UserControl
|
||||
{
|
||||
public DigitalInputCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class DigitalInputCollectionViewModel : ObservableViewModel
|
||||
{
|
||||
public DigitalInputCollectionViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<UserControl
|
||||
x:Class="KingPing.DigitalOutputCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
Digital Outputs
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class DigitalOutputCollectionView : UserControl
|
||||
{
|
||||
public DigitalOutputCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class DigitalOutputCollectionViewModel : ObservableViewModel
|
||||
{
|
||||
public DigitalOutputCollectionViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<UserControl
|
||||
x:Class="KingPing.FavouriteCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
Favourites
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class FavouriteCollectionView : UserControl
|
||||
{
|
||||
public FavouriteCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class FavouriteCollectionViewModel : ObservableViewModel
|
||||
{
|
||||
public FavouriteCollectionViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<UserControl
|
||||
x:Class="KingPing.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="{Route {Binding Route},
|
||||
Main}"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
Shell,
|
||||
Route=Main}" />
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class MainViewModel : ObservableViewModel
|
||||
{
|
||||
public MainViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Window
|
||||
x:Class="KingPing.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="{Route {Binding Route},
|
||||
Window}"
|
||||
Loaded="{Navigate {Binding EventAggregator},
|
||||
Main,
|
||||
Route=Window}" />
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using PropertyChanged;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class MainWindowViewModel : ObservableViewModel
|
||||
{
|
||||
public MainWindowViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<NavigationView
|
||||
x:Class="KingPing.ShellView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Name="NavigationView"
|
||||
PaneDisplayMode="Top"
|
||||
SelectionChanged="{Navigate {Binding EventAggregator} {Binding #NavigationView.SelectedItem.Tag}, Route=Frame}">
|
||||
<NavigationView.MenuItems>
|
||||
<NavigationViewItem Content="Digital Outputs" Tag="DigitalOutputs" />
|
||||
<NavigationViewItem Content="Digital Inputs" Tag="DigitalInputs" />
|
||||
<NavigationViewItem Content="Analog Outputs" Tag="AnalogOutputs" />
|
||||
<NavigationViewItem Content="Favourites" Tag="Favourites" />
|
||||
</NavigationView.MenuItems>
|
||||
<Frame Content="{Route {Binding Route}, Frame}" />
|
||||
</NavigationView>
|
||||
@@ -0,0 +1,13 @@
|
||||
using PropertyChanged;
|
||||
using TheXamlGuy.UI.Avalonia.Controls;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
[DoNotNotify]
|
||||
public partial class ShellView : NavigationView
|
||||
{
|
||||
public ShellView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using TheXamlGuy.Framework.Avalonia;
|
||||
using TheXamlGuy.Framework.Core;
|
||||
|
||||
namespace KingPing;
|
||||
|
||||
public class ShellViewModel : ObservableViewModel
|
||||
{
|
||||
public ShellViewModel(IPropertyBuilder propertyBuilder,
|
||||
IEventAggregator eventAggregator,
|
||||
IServiceFactory serviceFactory,
|
||||
IDisposer disposer,
|
||||
IRouter route) : base(propertyBuilder, eventAggregator, serviceFactory, disposer)
|
||||
{
|
||||
Route = route;
|
||||
}
|
||||
|
||||
public IRouter Route { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user