-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add hard minimum os version restriction
- Loading branch information
Showing
6 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<UserControl x:Class="MusicX.Controls.WindowsVersionBlock" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:MusicX.Controls" | ||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" | ||
mc:Ignorable="d" | ||
Name="Control" | ||
DataContext="{Binding Version, ElementName=Control}" | ||
d:DesignHeight="300" d:DesignWidth="300"> | ||
<UserControl.Resources> | ||
<Style TargetType="ui:Card" BasedOn="{StaticResource {x:Type ui:Card}}"> | ||
<Setter Property="Padding" Value="6" /> | ||
<Setter Property="HorizontalContentAlignment" Value="Center" /> | ||
<Setter Property="VerticalContentAlignment" Value="Center" /> | ||
</Style> | ||
</UserControl.Resources> | ||
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> | ||
<TextBlock TextAlignment="Center" FontWeight="SemiBold" FontSize="24"> | ||
<ui:Card Content="{Binding Major, FallbackValue=10}" /> | ||
<Run>.</Run> | ||
<ui:Card Content="{Binding Minor, FallbackValue=0}" /> | ||
<Run>.</Run> | ||
<ui:Card Content="{Binding Build, FallbackValue=19041}" /> | ||
<Run>.</Run> | ||
<ui:Card Content="{Binding Revision, FallbackValue=0}" /> | ||
</TextBlock> | ||
</StackPanel> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace MusicX.Controls; | ||
|
||
public partial class WindowsVersionBlock : UserControl | ||
{ | ||
public static readonly DependencyProperty VersionProperty = DependencyProperty.Register( | ||
nameof(Version), typeof(Version), typeof(WindowsVersionBlock), new PropertyMetadata(default(Version))); | ||
|
||
public Version Version | ||
{ | ||
get => (Version)GetValue(VersionProperty); | ||
set => SetValue(VersionProperty, value); | ||
} | ||
|
||
public WindowsVersionBlock() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Window x:Class="MusicX.Views.UnsupportedOsVersionWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:MusicX.Views" | ||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" | ||
xmlns:controls="clr-namespace:MusicX.Controls" | ||
xmlns:services="clr-namespace:MusicX.Services" | ||
mc:Ignorable="d" | ||
Title="Неподдерживаемая версия Windows" Height="450" Width="800"> | ||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<ui:TextBlock FontTypography="Title" TextAlignment="Center">Упс! Кажется ваша система слишком устарела</ui:TextBlock> | ||
<ui:TextBlock FontTypography="Subtitle" TextAlignment="Center">Пожалуйста обновите Windows.</ui:TextBlock> | ||
<ui:Card Margin="0 20"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<ui:TextBlock Margin="0 0 0 5" FontTypography="BodyStrong" TextAlignment="Center">Минимальная версия системы</ui:TextBlock> | ||
<controls:WindowsVersionBlock Grid.Row="1" Version="{x:Static services:StaticService.MinimumOsVersion}" /> | ||
</Grid> | ||
<ui:Card.Footer> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<ui:TextBlock Margin="0 0 0 5" FontTypography="Body" TextAlignment="Center">У вас сейчас установлена версия</ui:TextBlock> | ||
<controls:WindowsVersionBlock Grid.Row="1" Version="{x:Static services:StaticService.CurrentOsVersion}" /> | ||
</Grid> | ||
</ui:Card.Footer> | ||
</ui:Card> | ||
</StackPanel> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace MusicX.Views; | ||
|
||
public partial class UnsupportedOsVersionWindow | ||
{ | ||
public UnsupportedOsVersionWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |