Shared UI - Renamed DataModelVisualizationService

Databindings - Started on some basic UI elements
This commit is contained in:
Robert committed 2020-08-27 16:47:09 +02:00
1 parent 2f41b52a03
commit 47ba6fcf5e
31 files changed
+423 -185

No files matched your search

@@ -0,0 +1,12 @@
<UserControl x:Class="Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings.DataBindingsTabView"
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:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>
@@ -0,0 +1,20 @@
using System.Reflection;
using Artemis.Core.Models.Profile.LayerProperties;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
{
public class DataBindingsTabViewModel : PropertyChangedBase
{
public DataBindingsTabViewModel(BaseLayerProperty layerProperty, PropertyInfo dataBindingProperty)
{
DisplayName = dataBindingProperty.Name.ToUpper();
LayerProperty = layerProperty;
DataBindingProperty = dataBindingProperty;
}
public string DisplayName { get; }
public BaseLayerProperty LayerProperty { get; }
public PropertyInfo DataBindingProperty { get; }
}
}
@@ -0,0 +1,24 @@
<UserControl x:Class="Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings.DataBindingsView"
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:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance local:DataBindingsViewModel}">
<TabControl Margin="0 -1 0 0"
ItemsSource="{Binding Tabs}"
DisplayMemberPath="DisplayName"
Style="{StaticResource MaterialDesignTabControl}">
<TabControl.ContentTemplate>
<DataTemplate>
<materialDesign:TransitioningContent OpeningEffect="{materialDesign:TransitionEffect FadeIn}">
<ContentControl s:View.Model="{Binding}" TextElement.Foreground="{DynamicResource MaterialDesignBody}" />
</materialDesign:TransitioningContent>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</UserControl>
@@ -0,0 +1,25 @@
using Artemis.Core.Models.Profile.LayerProperties;
using Stylet;
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
{
public class DataBindingsViewModel : PropertyChangedBase
{
public DataBindingsViewModel(BaseLayerProperty layerProperty)
{
Tabs = new BindableCollection<DataBindingsTabViewModel>();
LayerProperty = layerProperty;
Initialise();
}
public BindableCollection<DataBindingsTabViewModel> Tabs { get; set; }
public BaseLayerProperty LayerProperty { get; }
private void Initialise()
{
foreach (var dataBindingProperty in LayerProperty.GetDataBindingProperties())
Tabs.Add(new DataBindingsTabViewModel(LayerProperty, dataBindingProperty));
}
}
}