Bug fixes
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Margin="20,4,0,4"
|
||||
Text="{Binding Description}"
|
||||
IsVisible="{Binding !IsDescriptionEditing}"/>
|
||||
<TextBox Grid.Column="0" Grid.Row="1" Margin="12,4,0,4"
|
||||
<TextBox Grid.Column="0" Grid.Row="1" Margin="12,4,0,4" AcceptsReturn="True" TextWrapping="Wrap"
|
||||
Text="{Binding Description}"
|
||||
IsVisible="{Binding IsDescriptionEditing}"/>
|
||||
<Button Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" Margin="10"
|
||||
@@ -73,12 +73,12 @@
|
||||
<Image Stretch="Uniform" Width="200" Height="200" Grid.RowSpan="3" Grid.ColumnSpan="5"
|
||||
Source="{Binding FileName}" />
|
||||
<Button Grid.Row="1" Grid.Column="1" Width="20" Height="20"
|
||||
Command="{Binding #Root.((vm:EditPointDialogViewModel)DataContext).ViewImageCommand}"
|
||||
Command="{Binding #Root.((vm:EditEquipmentDialogViewModel)DataContext).ViewImageCommand}"
|
||||
CommandParameter="{Binding .}">
|
||||
<Image Width="16" Height="16" Source="avares://GazpromApp/Assets/ic_fluent_eye_show_24_filled (Custom) 16.png"/>
|
||||
</Button>
|
||||
<Button Grid.Row="1" Grid.Column="3" Width="20" Height="20"
|
||||
Command="{Binding #Root.((vm:EditPointDialogViewModel)DataContext).DeleteImageCommand}"
|
||||
Command="{Binding #Root.((vm:EditEquipmentDialogViewModel)DataContext).DeleteImageCommand}"
|
||||
CommandParameter="{Binding .}">
|
||||
<Image Width="16" Height="16" Source="avares://GazpromApp/Assets/ic_fluent_delete_24_filled (Custom) 16.png"/>
|
||||
</Button>
|
||||
@@ -137,7 +137,8 @@
|
||||
|
||||
<TextBlock Grid.Column="2" Margin="16,0,0,0" Text="Период: " FontSize="18" VerticalAlignment="Center"/>
|
||||
<NumericUpDown Grid.Column="3" AllowSpin="True" Width="120" VerticalAlignment="Center"
|
||||
Value="{Binding PeriodValue}"/>
|
||||
Value="{Binding PeriodValue}"
|
||||
Minimum="0"/>
|
||||
<ComboBox Grid.Column="4" Width="100" VerticalAlignment="Center" Margin="4,0,0,0"
|
||||
ItemsSource="{Binding #Root.((vm:EditEquipmentDialogViewModel)DataContext).AllPeriods}"
|
||||
SelectedItem="{Binding PeriodType, Mode=TwoWay}"
|
||||
|
||||
@@ -35,10 +35,6 @@ public partial class EditEquipmentDialog : Window
|
||||
m.Reply(dialog.ShowDialog<ErrorViewModel?>(w));
|
||||
});
|
||||
|
||||
// new property dialog
|
||||
|
||||
// edit property dialog
|
||||
|
||||
// complete editing equipment
|
||||
WeakReferenceMessenger.Default.Register<EditEquipmentDialog, EditEquipmentDone>(this, static (w, m) =>
|
||||
{
|
||||
@@ -56,8 +52,6 @@ public partial class EditEquipmentDialog : Window
|
||||
{
|
||||
WeakReferenceMessenger.Default.Unregister<ViewImageMessage>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<ErrorMessage>(this);
|
||||
//
|
||||
//
|
||||
WeakReferenceMessenger.Default.Unregister<EditEquipmentDone>(this);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Margin="20,4,0,4"
|
||||
Text="{Binding Description}"
|
||||
IsVisible="{Binding !IsDescriptionEditing}"/>
|
||||
<TextBox Grid.Column="0" Grid.Row="1" Margin="12,4,0,4"
|
||||
<TextBox Grid.Column="0" Grid.Row="1" Margin="12,4,0,4" AcceptsReturn="True" TextWrapping="Wrap"
|
||||
Text="{Binding Description}"
|
||||
IsVisible="{Binding IsDescriptionEditing}"/>
|
||||
<Button Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" Margin="10"
|
||||
|
||||
@@ -61,30 +61,7 @@ public partial class EditPointDialog : Window
|
||||
// re registering error when new equipment done
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, NewEquipmentDone>(this, (_, _) =>
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ErrorMessage>(this, static (w, m) =>
|
||||
{
|
||||
var dialog = new ErrorView
|
||||
{
|
||||
DataContext = m.Error
|
||||
};
|
||||
m.Reply(dialog.ShowDialog<ErrorViewModel?>(w));
|
||||
});
|
||||
});
|
||||
|
||||
// re registering view image and error view
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, EditEquipmentDone>(this, (_, _) =>
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ViewImageMessage>(this, static (w, m) =>
|
||||
{
|
||||
var dialog = new ImageView
|
||||
{
|
||||
DataContext = m.Image
|
||||
};
|
||||
m.Reply(dialog.ShowDialog<ImageViewModel?>(w));
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
if (!WeakReferenceMessenger.Default.IsRegistered<ErrorMessage>(this))
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ErrorMessage>(this, static (w, m) =>
|
||||
{
|
||||
var dialog = new ErrorView
|
||||
@@ -93,16 +70,30 @@ public partial class EditPointDialog : Window
|
||||
};
|
||||
m.Reply(dialog.ShowDialog<ErrorViewModel?>(w));
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
});
|
||||
|
||||
// new property
|
||||
|
||||
// edit property
|
||||
// re registering view image and error view
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, EditEquipmentDone>(this, (_, _) =>
|
||||
{
|
||||
if (!WeakReferenceMessenger.Default.IsRegistered<ViewImageMessage>(this))
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ViewImageMessage>(this, static (w, m) =>
|
||||
{
|
||||
var dialog = new ImageView
|
||||
{
|
||||
DataContext = m.Image
|
||||
};
|
||||
m.Reply(dialog.ShowDialog<ImageViewModel?>(w));
|
||||
});
|
||||
if (!WeakReferenceMessenger.Default.IsRegistered<ErrorMessage>(this))
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ErrorMessage>(this, static (w, m) =>
|
||||
{
|
||||
var dialog = new ErrorView
|
||||
{
|
||||
DataContext = m.Error
|
||||
};
|
||||
m.Reply(dialog.ShowDialog<ErrorViewModel?>(w));
|
||||
});
|
||||
});
|
||||
|
||||
// complete editing point
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, EditPointDone>(this, static (w, m) =>
|
||||
@@ -123,8 +114,6 @@ public partial class EditPointDialog : Window
|
||||
WeakReferenceMessenger.Default.Unregister<ErrorMessage>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<NewEquipmentMessage>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<EditEquipmentMessage>(this);
|
||||
// new prop
|
||||
// edit prop
|
||||
WeakReferenceMessenger.Default.Unregister<EditPointDone>(this);
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Margin="8" Text="Изображение: "/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="8"
|
||||
Text="{Binding Name}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Margin="8"
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Margin="8" AcceptsReturn="True" TextWrapping="Wrap"
|
||||
Text="{Binding Description}"/>
|
||||
|
||||
<Panel Grid.Column="1" Grid.Row="2" Margin="8" IsVisible="{Binding !IsImagesEmpty}">
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Margin="8" Text="Изображение: "/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="8"
|
||||
Text="{Binding Name}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Margin="8"
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Margin="8" AcceptsReturn="True" TextWrapping="Wrap"
|
||||
Text="{Binding Description}"/>
|
||||
<Panel Grid.Column="1" Grid.Row="2" Margin="8" IsVisible="{Binding !IsImagesEmpty}">
|
||||
<ScrollViewer>
|
||||
|
||||
@@ -12,7 +12,7 @@ public partial class NewPointDialog : Window
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// done entering new point
|
||||
// done entering a new point
|
||||
WeakReferenceMessenger.Default.Register<NewPointDialog, NewPointDone>(this, static (w, m) =>
|
||||
{
|
||||
w.Close(m.Point);
|
||||
|
||||
Reference in New Issue
Block a user