Code clean up
This commit is contained in:
@@ -2,15 +2,12 @@
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using GazpromApp.Messages;
|
||||
using GazpromApp.Models;
|
||||
using GazpromApp.ViewModels;
|
||||
|
||||
namespace GazpromApp.Views;
|
||||
|
||||
public partial class EditPointDialog : Window
|
||||
{
|
||||
public Point? Point;
|
||||
|
||||
public EditPointDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -21,7 +18,7 @@ public partial class EditPointDialog : Window
|
||||
// view image
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ViewImageMessage>(this, static (w, m) =>
|
||||
{
|
||||
ImageView dialog = new ImageView()
|
||||
var dialog = new ImageView
|
||||
{
|
||||
DataContext = m.Image
|
||||
};
|
||||
@@ -31,7 +28,7 @@ public partial class EditPointDialog : Window
|
||||
// error
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ErrorMessage>(this, static (w, m) =>
|
||||
{
|
||||
ErrorView dialog = new ErrorView()
|
||||
var dialog = new ErrorView
|
||||
{
|
||||
DataContext = m.Error
|
||||
};
|
||||
@@ -42,7 +39,7 @@ public partial class EditPointDialog : Window
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, NewEquipmentMessage>(this, (w, m) =>
|
||||
{
|
||||
WeakReferenceMessenger.Default.Unregister<ErrorMessage>(this);
|
||||
NewEquipmentDialog dialog = new NewEquipmentDialog()
|
||||
var dialog = new NewEquipmentDialog
|
||||
{
|
||||
DataContext = new NewEquipmentDialogViewModel()
|
||||
};
|
||||
@@ -54,7 +51,7 @@ public partial class EditPointDialog : Window
|
||||
{
|
||||
WeakReferenceMessenger.Default.Unregister<ViewImageMessage>(this);
|
||||
WeakReferenceMessenger.Default.Unregister<ErrorMessage>(this);
|
||||
EditEquipmentDialog dialog = new EditEquipmentDialog()
|
||||
var dialog = new EditEquipmentDialog
|
||||
{
|
||||
DataContext = new EditEquipmentDialogViewModel(m.Equipment)
|
||||
};
|
||||
@@ -66,7 +63,7 @@ public partial class EditPointDialog : Window
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ErrorMessage>(this, static (w, m) =>
|
||||
{
|
||||
ErrorView dialog = new ErrorView()
|
||||
var dialog = new ErrorView
|
||||
{
|
||||
DataContext = m.Error
|
||||
};
|
||||
@@ -79,7 +76,7 @@ public partial class EditPointDialog : Window
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ViewImageMessage>(this, static (w, m) =>
|
||||
{
|
||||
ImageView dialog = new ImageView()
|
||||
var dialog = new ImageView
|
||||
{
|
||||
DataContext = m.Image
|
||||
};
|
||||
@@ -88,7 +85,7 @@ public partial class EditPointDialog : Window
|
||||
|
||||
WeakReferenceMessenger.Default.Register<EditPointDialog, ErrorMessage>(this, static (w, m) =>
|
||||
{
|
||||
ErrorView dialog = new ErrorView()
|
||||
var dialog = new ErrorView
|
||||
{
|
||||
DataContext = m.Error
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user