Added device identification to surface editor

Fixed dialog rendering
Cleaned up XAML
This commit is contained in:
SpoinkyNL committed 2019-11-22 20:46:34 +01:00
1 parent 733c9bf1a5
commit 25f8f1e72f
24 files changed
+165 -79

No files matched your search

@@ -30,7 +30,7 @@ namespace Artemis.UI.Screens.Module
// Create the profile editor and module VMs
if (Module is ProfileModule profileModule)
{
var profileEditor = _profileEditorViewModelFactory.CreateModuleViewModel(profileModule);
var profileEditor = _profileEditorViewModelFactory.Create(profileModule);
Items.Add(profileEditor);
}
@@ -12,8 +12,10 @@
Add a new profile
</TextBlock>
<TextBox materialDesign:HintAssist.Hint="Profile name" Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding ProfileName}" />
<TextBox materialDesign:HintAssist.Hint="Profile name"
Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Text="{Binding ProfileName, UpdateSourceTrigger=PropertyChanged}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
@@ -135,7 +135,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
profiles = profiles.Where(p => p.EntityId != activeProfile.EntityId).ToList();
profiles.Add(activeProfile);
Execute.OnUIThread(() =>
Execute.PostToUIThread(() =>
{
// Populate the UI collection
Profiles.Clear();
@@ -20,7 +20,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
Width = Led.ActualSize.Width;
Height = Led.ActualSize.Height;
Execute.OnUIThread(CreateLedGeometry);
Execute.PostToUIThread(CreateLedGeometry);
}
public Led Led { get; }
@@ -106,7 +106,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
public void Update()
{
var newColor = Led.Color.ToMediaColor();
Execute.OnUIThread(() =>
Execute.PostToUIThread(() =>
{
if (!DisplayColor.Equals(newColor))
DisplayColor = newColor;
@@ -24,7 +24,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
public ProfileViewModel(ISurfaceService surfaceService, ISettingsService settingsService)
{
Devices = new ObservableCollection<ProfileDeviceViewModel>();
Execute.OnUIThread(() =>
Execute.PostToUIThread(() =>
{
SelectionRectangle = new RectangleGeometry();
PanZoomViewModel = new PanZoomViewModel();
@@ -63,7 +63,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
{
// Create outside the UI thread to avoid slowdowns as much as possible
var profileDeviceViewModel = new ProfileDeviceViewModel(surfaceDeviceConfiguration);
Execute.OnUIThread(() =>
Execute.PostToUIThread(() =>
{
// Gotta call IsInitializing on the UI thread or its never gets picked up
IsInitializing = true;
@@ -79,7 +79,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
}
// Sort the devices by ZIndex
Execute.OnUIThread(() =>
Execute.PostToUIThread(() =>
{
lock (Devices)
{