Browse Source

Add mock launchviewmodel

pull/5/head
Ionite 1 year ago
parent
commit
5ff5cd77dc
No known key found for this signature in database
  1. 33
      StabilityMatrix/DesignData/MockLaunchViewModel.cs
  2. 11
      StabilityMatrix/LaunchPage.xaml

33
StabilityMatrix/DesignData/MockLaunchViewModel.cs

@ -0,0 +1,33 @@
using System.ComponentModel;
using Microsoft.Extensions.Logging;
using StabilityMatrix.Helper;
using StabilityMatrix.Python;
using StabilityMatrix.ViewModels;
using Wpf.Ui.Contracts;
using ISnackbarService = StabilityMatrix.Helper.ISnackbarService;
namespace StabilityMatrix.DesignData;
[DesignOnly(true)]
public class MockLaunchViewModel : LaunchViewModel
{
public MockLaunchViewModel() : base(
null!, null!, null!,
null!, null!, null!,
null!, null!)
{
InstalledPackages = new()
{
new()
{
DisplayName = "Mock Package",
PackageName = "mock-package",
PackageVersion = "1.0.0",
DisplayVersion = "1.0.0",
InstalledBranch = "main",
Path = @"C:\Users\AppData\StabilityMatrix\mock-package",
}
};
SelectedPackage = InstalledPackages[0];
}
}

11
StabilityMatrix/LaunchPage.xaml

@ -2,16 +2,17 @@
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Loaded="LaunchPage_OnLoaded"
Title="LaunchPage"
d:DataContext="{d:DesignInstance Type=viewModels:LaunchViewModel,
d:DataContext="{d:DesignInstance Type=designViewModels:MockLaunchViewModel,
IsDesignTimeCreatable=True}"
d:DesignHeight="450"
d:DesignWidth="700"
mc:Ignorable="d"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d"
x:Class="StabilityMatrix.LaunchPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:designViewModels="clr-namespace:StabilityMatrix.DesignData"
xmlns:local="clr-namespace:StabilityMatrix"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="clr-namespace:StabilityMatrix.Models"
@ -54,7 +55,9 @@
<StackPanel
Grid.Column="0"
Margin="10,0,0,0"
VerticalAlignment="Top">
VerticalAlignment="Top"
d:DataContext="{d:DesignInstance Type=models:InstalledPackage,
IsDesignTimeCreatable=True}">
<TextBlock Margin="0,5,0,5" Text="{Binding DisplayName}" />
<TextBlock Margin="0,0,0,5" Text="{Binding Path}" />
</StackPanel>
@ -105,8 +108,8 @@
FontSize="18"
Grid.Column="0"
Grid.Row="0"
Margin="24,8,0,0"
IsOpen="{Binding IsLaunchTeachingTipsOpen, Mode=TwoWay}"
Margin="24,8,0,0"
Placement="Bottom">
<StackPanel Orientation="Horizontal">
<Grid HorizontalAlignment="Left">

Loading…
Cancel
Save