mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Some UI stuff
This commit is contained in:
1 parent
6b8a8b6b4e
commit
0f3c85db6b
9 files changed
+111
-15
No files matched your search
@@ -0,0 +1,22 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.SidebarView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:interfaces="clr-namespace:Artemis.UI.ViewModels.Interfaces"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<ListBox Margin="0 16 0 16"
|
||||
SelectedIndex="0"
|
||||
ItemsSource="{Binding MenuItems}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="interfaces:IArtemisViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="{Binding Icon}" />
|
||||
<TextBlock Text="{Binding Title}" Margin="32 0 32 0" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Artemis.UI.ViewModels;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SidebarView.xaml
|
||||
/// </summary>
|
||||
public partial class SidebarView : UserControl, IViewFor<ISidebarViewModel>
|
||||
{
|
||||
public static readonly DependencyProperty ViewModelProperty =
|
||||
DependencyProperty.Register("ViewModel", typeof(ISidebarViewModel), typeof(SidebarView), new PropertyMetadata(null));
|
||||
|
||||
public SidebarView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.WhenAnyValue(x => x.ViewModel).BindTo(this, x => x.DataContext);
|
||||
}
|
||||
|
||||
object IViewFor.ViewModel
|
||||
{
|
||||
get => ViewModel;
|
||||
set => ViewModel = (ISidebarViewModel)value;
|
||||
}
|
||||
|
||||
public ISidebarViewModel ViewModel { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user