remove separate initializecomponent call.
This commit is contained in:
parent
b4690d6158
commit
c5e6cbf7bd
|
@ -2,7 +2,6 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Browser;
|
using Avalonia.Browser;
|
||||||
using Avalonia.ReactiveUI;
|
|
||||||
using ControlCatalogStandalone;
|
using ControlCatalogStandalone;
|
||||||
|
|
||||||
[assembly: SupportedOSPlatform("browser")]
|
[assembly: SupportedOSPlatform("browser")]
|
||||||
|
@ -11,7 +10,6 @@ internal partial class Program
|
||||||
{
|
{
|
||||||
private static async Task Main(string[] args) => await BuildAvaloniaApp()
|
private static async Task Main(string[] args) => await BuildAvaloniaApp()
|
||||||
.WithInterFont()
|
.WithInterFont()
|
||||||
.UseReactiveUI()
|
|
||||||
.StartBrowserAppAsync("out");
|
.StartBrowserAppAsync("out");
|
||||||
|
|
||||||
public static AppBuilder BuildAvaloniaApp()
|
public static AppBuilder BuildAvaloniaApp()
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace ControlCatalogStandalone
|
||||||
{
|
{
|
||||||
public DecoratedWindow()
|
public DecoratedWindow()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupSide(string name, StandardCursorType cursor, WindowEdge edge)
|
void SetupSide(string name, StandardCursorType cursor, WindowEdge edge)
|
||||||
|
@ -38,7 +38,7 @@ namespace ControlCatalogStandalone
|
||||||
SetupSide("TopRight", StandardCursorType.TopRightCorner, WindowEdge.NorthEast);
|
SetupSide("TopRight", StandardCursorType.TopRightCorner, WindowEdge.NorthEast);
|
||||||
SetupSide("BottomLeft", StandardCursorType.BottomLeftCorner, WindowEdge.SouthWest);
|
SetupSide("BottomLeft", StandardCursorType.BottomLeftCorner, WindowEdge.SouthWest);
|
||||||
SetupSide("BottomRight", StandardCursorType.BottomRightCorner, WindowEdge.SouthEast);
|
SetupSide("BottomRight", StandardCursorType.BottomRightCorner, WindowEdge.SouthEast);
|
||||||
this.Get<Button>("MinimizeButton").Click += delegate { this.WindowState = WindowState.Minimized; };
|
this.Get<Button>("MinimizeButton").Click += delegate { WindowState = WindowState.Minimized; };
|
||||||
this.Get<Button>("MaximizeButton").Click += delegate
|
this.Get<Button>("MaximizeButton").Click += delegate
|
||||||
{
|
{
|
||||||
WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
||||||
|
|
|
@ -35,9 +35,5 @@ namespace ControlCatalogStandalone
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,13 +11,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
public AdornerLayerPage()
|
public AdornerLayerPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RemoveAdorner_OnClick(object? sender, RoutedEventArgs e)
|
private void RemoveAdorner_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
public AutoCompleteBoxPage()
|
public AutoCompleteBoxPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
States = BuildAllStates();
|
States = BuildAllStates();
|
||||||
Sentences = BuildAllSentences();
|
Sentences = BuildAllSentences();
|
||||||
|
@ -196,10 +196,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
}
|
}
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public BorderPage()
|
public BorderPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,13 +10,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ButtonSpinnerPage()
|
public ButtonSpinnerPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSpin(object sender, SpinEventArgs e)
|
public void OnSpin(object sender, SpinEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,10 +14,6 @@ namespace ControlCatalogStandalone.Pages
|
||||||
this.Get<RepeatButton>("RepeatButton").Click += OnRepeatButtonClick;
|
this.Get<RepeatButton>("RepeatButton").Click += OnRepeatButtonClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnRepeatButtonClick(object? sender, object args)
|
public void OnRepeatButtonClick(object? sender, object args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,9 +28,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public CalendarPage()
|
public CalendarPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
var today = DateTime.Today;
|
var today = DateTime.Today;
|
||||||
var cal1 = this.Get<Calendar>("DisplayDatesCalendar");
|
var cal1 = this.Get<Calendar>("DisplayDatesCalendar");
|
||||||
|
@ -20,9 +20,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
cal2.BlackoutDates.Add(new CalendarDateRange(today.AddDays(6)));
|
cal2.BlackoutDates.Add(new CalendarDateRange(today.AddDays(6)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public CanvasPage()
|
public CanvasPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public CheckBoxPage()
|
public CheckBoxPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,6 @@ namespace ControlCatalogStandalone.Pages
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void CopyText(object? sender, RoutedEventArgs args)
|
private async void CopyText(object? sender, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +106,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
if (TopLevel.GetTopLevel(this)?.Clipboard is { } clipboard)
|
if (TopLevel.GetTopLevel(this)?.Clipboard is { } clipboard)
|
||||||
{
|
{
|
||||||
var files = await clipboard.GetDataAsync(DataFormats.Files) as IEnumerable<Avalonia.Platform.Storage.IStorageItem>;
|
var files = await clipboard.GetDataAsync(DataFormats.Files) as IEnumerable<IStorageItem>;
|
||||||
|
|
||||||
ClipboardContent.Text = files != null ? string.Join(Environment.NewLine, files.Select(f => f.TryGetLocalPath() ?? f.Name)) : string.Empty;
|
ClipboardContent.Text = files != null ? string.Join(Environment.NewLine, files.Select(f => f.TryGetLocalPath() ?? f.Name)) : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
layoutRoot.Children.Add(colorPicker);
|
layoutRoot.Children.Add(colorPicker);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ComboBoxPage()
|
public ComboBoxPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new ComboBoxPageViewModel();
|
DataContext = new ComboBoxPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,9 +84,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ContextMenuPage()
|
public ContextMenuPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new ContextPageViewModel();
|
DataContext = new ContextPageViewModel();
|
||||||
|
|
||||||
var customContextRequestedBorder = this.Get<Border>("CustomContextRequestedBorder");
|
var customContextRequestedBorder = this.Get<Border>("CustomContextRequestedBorder");
|
||||||
|
@ -62,9 +62,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public CursorPage()
|
public CursorPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new CursorPageViewModel();
|
DataContext = new CursorPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,26 +120,26 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
public override void Render(DrawingContext context)
|
public override void Render(DrawingContext context)
|
||||||
{
|
{
|
||||||
var localBounds = new Rect(new Size(this.Bounds.Width, this.Bounds.Height));
|
var localBounds = new Rect(new Size(Bounds.Width, Bounds.Height));
|
||||||
var clip = context.PushClip(this.Bounds);
|
var clip = context.PushClip(Bounds);
|
||||||
context.DrawRectangle(Brushes.White, _pen, localBounds, 1.0d);
|
context.DrawRectangle(Brushes.White, _pen, localBounds, 1.0d);
|
||||||
|
|
||||||
var halfMax = Math.Max(this.Bounds.Width / 2.0d, this.Bounds.Height / 2.0d) * Math.Sqrt(2.0d);
|
var halfMax = Math.Max(Bounds.Width / 2.0d, Bounds.Height / 2.0d) * Math.Sqrt(2.0d);
|
||||||
var halfMin = Math.Min(this.Bounds.Width / 2.0d, this.Bounds.Height / 2.0d) / 1.3d;
|
var halfMin = Math.Min(Bounds.Width / 2.0d, Bounds.Height / 2.0d) / 1.3d;
|
||||||
var halfWidth = this.Bounds.Width / 2.0d;
|
var halfWidth = Bounds.Width / 2.0d;
|
||||||
var halfHeight = this.Bounds.Height / 2.0d;
|
var halfHeight = Bounds.Height / 2.0d;
|
||||||
|
|
||||||
// 0,0 refers to the top-left of the control now. It is not prime time to draw gui stuff because it'll be under the world
|
// 0,0 refers to the top-left of the control now. It is not prime time to draw gui stuff because it'll be under the world
|
||||||
|
|
||||||
var translateModifier = context.PushTransform(Avalonia.Matrix.CreateTranslation(new Avalonia.Vector(halfWidth, halfHeight)));
|
var translateModifier = context.PushTransform(Matrix.CreateTranslation(new Vector(halfWidth, halfHeight)));
|
||||||
|
|
||||||
// now 0,0 refers to the ViewportCenter(X,Y).
|
// now 0,0 refers to the ViewportCenter(X,Y).
|
||||||
var rotationMatrix = Avalonia.Matrix.CreateRotation(Rotation);
|
var rotationMatrix = Matrix.CreateRotation(Rotation);
|
||||||
var rotationModifier = context.PushTransform(rotationMatrix);
|
var rotationModifier = context.PushTransform(rotationMatrix);
|
||||||
|
|
||||||
// everything is rotated but not scaled
|
// everything is rotated but not scaled
|
||||||
|
|
||||||
var scaleModifier = context.PushTransform(Avalonia.Matrix.CreateScale(Scale, -Scale));
|
var scaleModifier = context.PushTransform(Matrix.CreateScale(Scale, -Scale));
|
||||||
|
|
||||||
var mapPositionModifier = context.PushTransform(Matrix.CreateTranslation(new Vector(-ViewportCenterX, -ViewportCenterY)));
|
var mapPositionModifier = context.PushTransform(Matrix.CreateTranslation(new Vector(-ViewportCenterX, -ViewportCenterY)));
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
private Point UIPointToWorldPoint(Point inPoint, double viewportCenterX, double viewportCenterY, double scale, double rotation)
|
private Point UIPointToWorldPoint(Point inPoint, double viewportCenterX, double viewportCenterY, double scale, double rotation)
|
||||||
{
|
{
|
||||||
Point workingPoint = new Point(inPoint.X, -inPoint.Y);
|
Point workingPoint = new Point(inPoint.X, -inPoint.Y);
|
||||||
workingPoint += new Vector(-this.Bounds.Width / 2.0d, this.Bounds.Height / 2.0d);
|
workingPoint += new Vector(-Bounds.Width / 2.0d, Bounds.Height / 2.0d);
|
||||||
workingPoint /= scale;
|
workingPoint /= scale;
|
||||||
|
|
||||||
workingPoint = Matrix.CreateRotation(rotation).Transform(workingPoint);
|
workingPoint = Matrix.CreateRotation(rotation).Transform(workingPoint);
|
||||||
|
@ -206,7 +206,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
// undo rotation
|
// undo rotation
|
||||||
workingPoint = Matrix.CreateRotation(-rotation).Transform(workingPoint);
|
workingPoint = Matrix.CreateRotation(-rotation).Transform(workingPoint);
|
||||||
workingPoint *= scale;
|
workingPoint *= scale;
|
||||||
workingPoint -= new Vector(-this.Bounds.Width / 2.0d, this.Bounds.Height / 2.0d);
|
workingPoint -= new Vector(-Bounds.Width / 2.0d, Bounds.Height / 2.0d);
|
||||||
workingPoint = new Point(workingPoint.X, -workingPoint.Y);
|
workingPoint = new Point(workingPoint.X, -workingPoint.Y);
|
||||||
|
|
||||||
return workingPoint;
|
return workingPoint;
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public DataGridPage()
|
public DataGridPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
var dataGridSortDescription = DataGridSortDescription.FromPath(nameof(Country.Region), ListSortDirection.Ascending, new ReversedStringComparer());
|
var dataGridSortDescription = DataGridSortDescription.FromPath(nameof(Country.Region), ListSortDirection.Ascending, new ReversedStringComparer());
|
||||||
var collectionView1 = new DataGridCollectionView(Countries.All);
|
var collectionView1 = new DataGridCollectionView(Countries.All);
|
||||||
|
@ -70,10 +70,6 @@ namespace ControlCatalogStandalone.Pages
|
||||||
e.Row.Header = e.Row.GetIndex() + 1;
|
e.Row.Header = e.Row.GetIndex() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ReversedStringComparer : IComparer<object>, IComparer
|
private class ReversedStringComparer : IComparer<object>, IComparer
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public DateTimePickerPage()
|
public DateTimePickerPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
this.Get<TextBlock>("DatePickerDesc").Text = "Use a DatePicker to let users set a date in your app, " +
|
this.Get<TextBlock>("DatePickerDesc").Text = "Use a DatePicker to let users set a date in your app, " +
|
||||||
"for example to schedule an appointment. The DatePicker displays three controls for month, day, and year. " +
|
"for example to schedule an appointment. The DatePicker displays three controls for month, day, and year. " +
|
||||||
"These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways. " +
|
"These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways. " +
|
||||||
|
@ -22,9 +22,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public DialogsPage()
|
public DialogsPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
IStorageFolder? lastSelectedDirectory = null;
|
IStorageFolder? lastSelectedDirectory = null;
|
||||||
bool ignoreTextChanged = false;
|
bool ignoreTextChanged = false;
|
||||||
|
@ -439,10 +439,6 @@ CanPickFolder: {storageProvider.CanPickFolder}";
|
||||||
Window GetWindow() => TopLevel.GetTopLevel(this) as Window ?? throw new NullReferenceException("Invalid Owner");
|
Window GetWindow() => TopLevel.GetTopLevel(this) as Window ?? throw new NullReferenceException("Invalid Owner");
|
||||||
TopLevel GetTopLevel() => TopLevel.GetTopLevel(this) ?? throw new NullReferenceException("Invalid Owner");
|
TopLevel GetTopLevel() => TopLevel.GetTopLevel(this) ?? throw new NullReferenceException("Invalid Owner");
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore CS0618 // Type or member is obsolete
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
private const string CustomFormat = "application/xxx-avalonia-ControlCatalogStandalone-custom";
|
private const string CustomFormat = "application/xxx-avalonia-ControlCatalogStandalone-custom";
|
||||||
public DragAndDropPage()
|
public DragAndDropPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
_dropState = this.Get<TextBlock>("DropState");
|
_dropState = this.Get<TextBlock>("DropState");
|
||||||
|
|
||||||
int textCount = 0;
|
int textCount = 0;
|
||||||
|
@ -30,7 +30,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
var dragMe = this.Get<Border>("DragMe" + suffix);
|
var dragMe = this.Get<Border>("DragMe" + suffix);
|
||||||
var dragState = this.Get<TextBlock>("DragState" + suffix);
|
var dragState = this.Get<TextBlock>("DragState" + suffix);
|
||||||
|
|
||||||
async void DoDrag(object? sender, Avalonia.Input.PointerPressedEventArgs e)
|
async void DoDrag(object? sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
var dragData = new DataObject();
|
var dragData = new DataObject();
|
||||||
factory(dragData);
|
factory(dragData);
|
||||||
|
@ -133,9 +133,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
AddHandler(DragDrop.DragOverEvent, DragOver);
|
AddHandler(DragDrop.DragOverEvent, DragOver);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ExpanderPage()
|
public ExpanderPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new ExpanderPageViewModel();
|
DataContext = new ExpanderPageViewModel();
|
||||||
|
|
||||||
var CollapsingDisabledExpander = this.Get<Expander>("CollapsingDisabledExpander");
|
var CollapsingDisabledExpander = this.Get<Expander>("CollapsingDisabledExpander");
|
||||||
|
@ -18,9 +18,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
ExpandingDisabledExpander.Expanding += (s, e) => { e.Cancel = true; };
|
ExpandingDisabledExpander.Expanding += (s, e) => { e.Cancel = true; };
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,13 +17,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
public GesturePage()
|
public GesturePage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -185,7 +181,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
InitComposition(ball!);
|
InitComposition(ball!);
|
||||||
if (ballCompositionVisual != null)
|
if (ballCompositionVisual != null)
|
||||||
{
|
{
|
||||||
ballCompositionVisual.Offset = defaultOffset + new System.Numerics.Vector3((float)e.Delta.X * 0.4f, (float)e.Delta.Y * 0.4f, 0) * (inverse ? -1 : 1);
|
ballCompositionVisual.Offset = defaultOffset + new Vector3((float)e.Delta.X * 0.4f, (float)e.Delta.Y * 0.4f, 0) * (inverse ? -1 : 1);
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,6 @@ namespace ControlCatalogStandalone.Pages
|
||||||
_croppedImage = this.Get<Image>("croppedImage");
|
_croppedImage = this.Get<Image>("croppedImage");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void BitmapStretchChanged(object sender, SelectionChangedEventArgs e)
|
public void BitmapStretchChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
public LabelsPage()
|
public LabelsPage()
|
||||||
{
|
{
|
||||||
CreateDefaultPerson();
|
CreateDefaultPerson();
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateDefaultPerson()
|
private void CreateDefaultPerson()
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public LayoutTransformControlPage()
|
public LayoutTransformControlPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
DataContext = new ListBoxPageViewModel();
|
DataContext = new ListBoxPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,14 +12,10 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public MenuPage()
|
public MenuPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new MenuPageViewModel();
|
DataContext = new MenuPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private MenuPageViewModel? _model;
|
private MenuPageViewModel? _model;
|
||||||
protected override void OnDataContextChanged(EventArgs e)
|
protected override void OnDataContextChanged(EventArgs e)
|
||||||
|
|
|
@ -15,13 +15,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public NativeEmbedPage()
|
public NativeEmbedPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async void ShowPopupDelay(object sender, RoutedEventArgs args)
|
public async void ShowPopupDelay(object sender, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,17 +11,13 @@ namespace ControlCatalogStandalone.Pages
|
||||||
|
|
||||||
public NotificationsPage()
|
public NotificationsPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
_viewModel = new NotificationViewModel();
|
_viewModel = new NotificationViewModel();
|
||||||
|
|
||||||
DataContext = _viewModel;
|
DataContext = _viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,15 +13,11 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public NumericUpDownPage()
|
public NumericUpDownPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
var viewModel = new NumbersPageViewModel();
|
var viewModel = new NumbersPageViewModel();
|
||||||
DataContext = viewModel;
|
DataContext = viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IValueConverter CultureConverter =
|
public static IValueConverter CultureConverter =
|
||||||
new FuncValueConverter<CultureInfo, NumberFormatInfo>(c => (c ?? CultureInfo.CurrentCulture).NumberFormat);
|
new FuncValueConverter<CultureInfo, NumberFormatInfo>(c => (c ?? CultureInfo.CurrentCulture).NumberFormat);
|
||||||
|
@ -44,13 +40,13 @@ namespace ControlCatalogStandalone.Pages
|
||||||
public double DoubleValue
|
public double DoubleValue
|
||||||
{
|
{
|
||||||
get { return _doubleValue; }
|
get { return _doubleValue; }
|
||||||
set { this.RaiseAndSetIfChanged(ref _doubleValue, value); }
|
set { RaiseAndSetIfChanged(ref _doubleValue, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public decimal DecimalValue
|
public decimal DecimalValue
|
||||||
{
|
{
|
||||||
get { return _decimalValue; }
|
get { return _decimalValue; }
|
||||||
set { this.RaiseAndSetIfChanged(ref _decimalValue, value); }
|
set { RaiseAndSetIfChanged(ref _decimalValue, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<FormatObject> Formats
|
public IList<FormatObject> Formats
|
||||||
|
@ -93,7 +89,7 @@ namespace ControlCatalogStandalone.Pages
|
||||||
public FormatObject? SelectedFormat
|
public FormatObject? SelectedFormat
|
||||||
{
|
{
|
||||||
get { return _selectedFormat; }
|
get { return _selectedFormat; }
|
||||||
set { this.RaiseAndSetIfChanged(ref _selectedFormat, value); }
|
set { RaiseAndSetIfChanged(ref _selectedFormat, value); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,13 +11,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public PlatformInfoPage()
|
public PlatformInfoPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new PlatformInformationViewModel();
|
DataContext = new PlatformInformationViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ public partial class PointersPage : UserControl
|
||||||
{
|
{
|
||||||
public PointersPage()
|
public PointersPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
var border1 = this.Get<Border>("BorderCapture1");
|
var border1 = this.Get<Border>("BorderCapture1");
|
||||||
var border2 = this.Get<Border>("BorderCapture2");
|
var border2 = this.Get<Border>("BorderCapture2");
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ProgressBarPage()
|
public ProgressBarPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public RadioButtonPage()
|
public RadioButtonPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,25 +49,25 @@ namespace ControlCatalogStandalone.Pages
|
||||||
public bool AllowAutoHide
|
public bool AllowAutoHide
|
||||||
{
|
{
|
||||||
get => _allowAutoHide;
|
get => _allowAutoHide;
|
||||||
set => this.RaiseAndSetIfChanged(ref _allowAutoHide, value);
|
set => RaiseAndSetIfChanged(ref _allowAutoHide, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool EnableInertia
|
public bool EnableInertia
|
||||||
{
|
{
|
||||||
get => _enableInertia;
|
get => _enableInertia;
|
||||||
set => this.RaiseAndSetIfChanged(ref _enableInertia, value);
|
set => RaiseAndSetIfChanged(ref _enableInertia, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScrollBarVisibility HorizontalScrollVisibility
|
public ScrollBarVisibility HorizontalScrollVisibility
|
||||||
{
|
{
|
||||||
get => _horizontalScrollVisibility;
|
get => _horizontalScrollVisibility;
|
||||||
set => this.RaiseAndSetIfChanged(ref _horizontalScrollVisibility, value);
|
set => RaiseAndSetIfChanged(ref _horizontalScrollVisibility, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScrollBarVisibility VerticalScrollVisibility
|
public ScrollBarVisibility VerticalScrollVisibility
|
||||||
{
|
{
|
||||||
get => _verticalScrollVisibility;
|
get => _verticalScrollVisibility;
|
||||||
set => this.RaiseAndSetIfChanged(ref _verticalScrollVisibility, value);
|
set => RaiseAndSetIfChanged(ref _verticalScrollVisibility, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ScrollBarVisibility> AvailableVisibility { get; }
|
public List<ScrollBarVisibility> AvailableVisibility { get; }
|
||||||
|
@ -75,19 +75,19 @@ namespace ControlCatalogStandalone.Pages
|
||||||
public bool AreSnapPointsRegular
|
public bool AreSnapPointsRegular
|
||||||
{
|
{
|
||||||
get => _areSnapPointsRegular;
|
get => _areSnapPointsRegular;
|
||||||
set => this.RaiseAndSetIfChanged(ref _areSnapPointsRegular, value);
|
set => RaiseAndSetIfChanged(ref _areSnapPointsRegular, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SnapPointsType SnapPointsType
|
public SnapPointsType SnapPointsType
|
||||||
{
|
{
|
||||||
get => _snapPointsType;
|
get => _snapPointsType;
|
||||||
set => this.RaiseAndSetIfChanged(ref _snapPointsType, value);
|
set => RaiseAndSetIfChanged(ref _snapPointsType, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SnapPointsAlignment SnapPointsAlignment
|
public SnapPointsAlignment SnapPointsAlignment
|
||||||
{
|
{
|
||||||
get => _snapPointsAlignment;
|
get => _snapPointsAlignment;
|
||||||
set => this.RaiseAndSetIfChanged(ref _snapPointsAlignment, value);
|
set => RaiseAndSetIfChanged(ref _snapPointsAlignment, value);
|
||||||
}
|
}
|
||||||
public List<SnapPointsType> AvailableSnapPointsType { get; }
|
public List<SnapPointsType> AvailableSnapPointsType { get; }
|
||||||
public List<SnapPointsAlignment> AvailableSnapPointsAlignment { get; }
|
public List<SnapPointsAlignment> AvailableSnapPointsAlignment { get; }
|
||||||
|
@ -102,9 +102,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
DataContext = new ScrollViewerPageViewModel();
|
DataContext = new ScrollViewerPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public SliderPage()
|
public SliderPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,9 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public SplitViewPage()
|
public SplitViewPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new SplitViewPageViewModel();
|
DataContext = new SplitViewPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,6 @@ namespace ControlCatalogStandalone.Pages
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Bitmap LoadBitmap(string uri)
|
private static Bitmap LoadBitmap(string uri)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,9 +31,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public TextBlockPage()
|
public TextBlockPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public TextBoxPage()
|
public TextBoxPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ToggleSwitchPage()
|
public ToggleSwitchPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public ToolTipPage()
|
public ToolTipPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
DataContext = new TreeViewPageViewModel();
|
DataContext = new TreeViewPageViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,5 @@ namespace ControlCatalogStandalone.Pages
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,8 @@ namespace ControlCatalogStandalone.Pages
|
||||||
{
|
{
|
||||||
public WindowCustomizationsPage()
|
public WindowCustomizationsPage()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace ControlCatalogStandalone.ViewModels
|
||||||
{
|
{
|
||||||
var dialog = new AboutAvaloniaDialog();
|
var dialog = new AboutAvaloniaDialog();
|
||||||
|
|
||||||
if ((App.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow is
|
if ((Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow is
|
||||||
{ } mainWindow)
|
{ } mainWindow)
|
||||||
{
|
{
|
||||||
await dialog.ShowDialog(mainWindow);
|
await dialog.ShowDialog(mainWindow);
|
||||||
|
@ -44,7 +44,7 @@ namespace ControlCatalogStandalone.ViewModels
|
||||||
});
|
});
|
||||||
ExitCommand = MiniCommand.Create(() =>
|
ExitCommand = MiniCommand.Create(() =>
|
||||||
{
|
{
|
||||||
(App.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Shutdown();
|
(Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Shutdown();
|
||||||
});
|
});
|
||||||
|
|
||||||
ToggleMenuItemCheckedCommand = MiniCommand.Create(() => { IsMenuItemChecked = !IsMenuItemChecked; });
|
ToggleMenuItemCheckedCommand = MiniCommand.Create(() => { IsMenuItemChecked = !IsMenuItemChecked; });
|
||||||
|
|
|
@ -16,22 +16,22 @@ namespace ControlCatalogStandalone.ViewModels
|
||||||
|
|
||||||
ShowManagedNotificationCommand = MiniCommand.Create(() =>
|
ShowManagedNotificationCommand = MiniCommand.Create(() =>
|
||||||
{
|
{
|
||||||
NotificationManager?.Show(new Avalonia.Controls.Notifications.Notification("Welcome", "Avalonia now supports Notifications.", NotificationType.Information));
|
NotificationManager?.Show(new Notification("Welcome", "Avalonia now supports Notifications.", NotificationType.Information));
|
||||||
});
|
});
|
||||||
|
|
||||||
ShowNativeNotificationCommand = MiniCommand.Create(() =>
|
ShowNativeNotificationCommand = MiniCommand.Create(() =>
|
||||||
{
|
{
|
||||||
NotificationManager?.Show(new Avalonia.Controls.Notifications.Notification("Error", "Native Notifications are not quite ready. Coming soon.", NotificationType.Error));
|
NotificationManager?.Show(new Notification("Error", "Native Notifications are not quite ready. Coming soon.", NotificationType.Error));
|
||||||
});
|
});
|
||||||
|
|
||||||
YesCommand = MiniCommand.Create(() =>
|
YesCommand = MiniCommand.Create(() =>
|
||||||
{
|
{
|
||||||
NotificationManager?.Show(new Avalonia.Controls.Notifications.Notification("Avalonia Notifications", "Start adding notifications to your app today."));
|
NotificationManager?.Show(new Notification("Avalonia Notifications", "Start adding notifications to your app today."));
|
||||||
});
|
});
|
||||||
|
|
||||||
NoCommand = MiniCommand.Create(() =>
|
NoCommand = MiniCommand.Create(() =>
|
||||||
{
|
{
|
||||||
NotificationManager?.Show(new Avalonia.Controls.Notifications.Notification("Avalonia Notifications", "Start adding notifications to your app today. To find out more visit..."));
|
NotificationManager?.Show(new Notification("Avalonia Notifications", "Start adding notifications to your app today. To find out more visit..."));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,8 @@ namespace ControlCatalogStandalone.Views
|
||||||
{
|
{
|
||||||
public CustomNotificationView()
|
public CustomNotificationView()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue