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

Loading…
Cancel
Save