[WIP] Dialog

This commit is contained in:
Yoshi Askharoun
2024-05-15 23:43:17 -05:00
parent 09077b26f9
commit fe65698a24
2 changed files with 65 additions and 62 deletions
+49 -50
View File
@@ -1,57 +1,56 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:zmhc="clr-namespace:ZuneModdingHelper.Controls">
<UserControl x:Class="ZuneModdingHelper.Controls.ZuneLightDialog"
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:ZuneModdingHelper.Controls"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Themes/Zune.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Themes/Zune.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Border Background="#AFFFFFFF">
<Border MaxHeight="408" MaxWidth="530" Padding="32">
<Border.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFFFFF" Offset="0"/>
<GradientStop Color="#F0F0F0" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<!-- TODO: Convert to UserControl -->
<Style TargetType="zmhc:ZuneLightDialog">
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="zmhc:ZuneLightDialog">
<Border Background="#AFFFFFFF">
<Border MaxHeight="408" MaxWidth="530" Padding="32">
<Border.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFFFFF" Offset="0"/>
<GradientStop Color="#F0F0F0" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle Height="5" Width="109" Margin="0,-16,0,0"
VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="{StaticResource ZuneHorizontalGradientAlt}"/>
<TextBlock Text="{Binding ViewModel.Title}" d:Text="WINDOWS LIVE ID" FontSize="28" Margin="0,-10,0,0"
Foreground="{StaticResource ZuneMediumTextBrush}"/>
<Rectangle Height="5" Width="109" Margin="0,-16,0,0"
VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="{StaticResource ZuneHorizontalGradientAlt}"/>
<TextBlock Text="WINDOWS LIVE ID" FontSize="28" Margin="0,-10,0,0"
Foreground="{StaticResource ZuneMediumTextBrush}"/>
<ContentControl Grid.Row="1" Content="TEst"
HorizontalAlignment="{Binding HorizontalContentAlignment}"
VerticalAlignment="{Binding VerticalContentAlignment}" />
<ContentPresenter Grid.Row="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Button Content="CANCEL" Grid.Row="2" HorizontalAlignment="Right"
FontSize="12" Height="24"
Style="{StaticResource ActionButtonStyle}"/>
</Grid>
<Button Content="CANCEL" Grid.Row="2" HorizontalAlignment="Right"
FontSize="12" Height="24"
Style="{StaticResource ActionButtonStyle}"/>
</Grid>
<Border.Effect>
<DropShadowEffect Color="Black" Opacity="0.45" BlurRadius="8"
Direction="0" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
<Border.Effect>
<DropShadowEffect Color="Black" Opacity="0.45" BlurRadius="8"
Direction="0" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl>
@@ -2,20 +2,24 @@
using System.Windows.Controls;
using ZuneModdingHelper.Messages;
namespace ZuneModdingHelper.Controls;
public class ZuneLightDialog : ContentControl
namespace ZuneModdingHelper.Controls
{
static ZuneLightDialog()
/// <summary>
/// Interaction logic for ZuneLightDialog.xaml
/// </summary>
public partial class ZuneLightDialog : UserControl
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ZuneLightDialog), new FrameworkPropertyMetadata(typeof(ZuneLightDialog)));
}
public ZuneLightDialog()
{
InitializeComponent();
}
public DialogViewModel ViewModel
{
get => (DialogViewModel)GetValue(DialogViewModelProperty);
set => SetValue(DialogViewModelProperty, value);
public DialogViewModel ViewModel
{
get => (DialogViewModel)GetValue(DialogViewModelProperty);
set => SetValue(DialogViewModelProperty, value);
}
public static readonly DependencyProperty DialogViewModelProperty = DependencyProperty.Register(
nameof(ViewModel), typeof(DialogViewModel), typeof(ZuneLightDialog), new PropertyMetadata(null));
}
public static readonly DependencyProperty DialogViewModelProperty = DependencyProperty.Register(
nameof(ViewModel), typeof(DialogViewModel), typeof(ZuneLightDialog), new PropertyMetadata(null));
}