Ionite
1 year ago
5 changed files with 69 additions and 0 deletions
@ -0,0 +1,14 @@
|
||||
using Avalonia.Media.Imaging; |
||||
using CommunityToolkit.Mvvm.ComponentModel; |
||||
using StabilityMatrix.Avalonia.ViewModels.Base; |
||||
using StabilityMatrix.Avalonia.Views.Dialogs; |
||||
using StabilityMatrix.Core.Attributes; |
||||
|
||||
namespace StabilityMatrix.Avalonia.ViewModels.Dialogs; |
||||
|
||||
[View(typeof(ImageViewerDialog))] |
||||
public partial class ImageViewerViewModel : ViewModelBase |
||||
{ |
||||
[ObservableProperty] |
||||
private Bitmap? image; |
||||
} |
@ -0,0 +1,30 @@
|
||||
<controls:UserControlBase xmlns="https://github.com/avaloniaui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
xmlns:vm="clr-namespace:StabilityMatrix.Avalonia.ViewModels" |
||||
xmlns:ui="using:FluentAvalonia.UI.Controls" |
||||
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
||||
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls" |
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime" |
||||
xmlns:vmDialogs="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Dialogs" |
||||
d:DataContext="{x:Static mocks:DesignData.ImageViewerViewModel}" |
||||
x:DataType="vmDialogs:ImageViewerViewModel" |
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
||||
x:Class="StabilityMatrix.Avalonia.Views.Dialogs.ImageViewerDialog"> |
||||
<Grid> |
||||
<controls:AdvancedImageBox |
||||
Name="MainImageBox" |
||||
RenderOptions.BitmapInterpolationMode="None" |
||||
Image="{Binding Image}"/> |
||||
|
||||
<!-- The preview tracker --> |
||||
<Image |
||||
MinHeight="100" |
||||
MinWidth="100" |
||||
RenderOptions.BitmapInterpolationMode="HighQuality" |
||||
Source="{Binding #MainImageBox.TrackerImage}" |
||||
HorizontalAlignment="Left" |
||||
VerticalAlignment="Bottom"/> |
||||
</Grid> |
||||
</controls:UserControlBase> |
@ -0,0 +1,18 @@
|
||||
using Avalonia; |
||||
using Avalonia.Controls; |
||||
using Avalonia.Markup.Xaml; |
||||
|
||||
namespace StabilityMatrix.Avalonia.Views.Dialogs; |
||||
|
||||
public partial class ImageViewerDialog : UserControl |
||||
{ |
||||
public ImageViewerDialog() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
private void InitializeComponent() |
||||
{ |
||||
AvaloniaXamlLoader.Load(this); |
||||
} |
||||
} |
Loading…
Reference in new issue