mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Initial work for AbstractUI options
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractBooleanUIElement"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractBooleanPresenter : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractButton"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractButtonPresenter : Control
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="AbstractButtonPresenter"/>.
|
||||
/// </summary>
|
||||
public AbstractButtonPresenter()
|
||||
{
|
||||
this.DefaultStyleKey = typeof(AbstractButtonPresenter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractDataList"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractDataListPresenter : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractMultiChoiceUIElement"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractMultiChoicePresenter : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractProgressUIElement"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractProgessUIElementPresenter : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractTextBox"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractRichTextBlockPresenter : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A control that displays an <see cref="AbstractTextBox"/>.
|
||||
/// </summary>
|
||||
public partial class AbstractTextBoxPresenter : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.ViewModels;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
using OwlCore.Wpf.Extensions;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// The template selector used to display Abstract UI elements. Use this to define your own custom styles for each control. You may specify the existing, default styles for those you don't want to override.
|
||||
/// </summary>
|
||||
public class AbstractUIGroupItemTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="AbstractUIGroupItemTemplateSelector"/>.
|
||||
/// </summary>
|
||||
public AbstractUIGroupItemTemplateSelector()
|
||||
{
|
||||
if (!new Themes.AbstractTextBoxStyle().TryGetValue("DefaultAbstractTextBoxTemplate", out var textBoxTemplate))
|
||||
{
|
||||
TextBoxTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(textBoxTemplate));
|
||||
}
|
||||
|
||||
if (!new Themes.AbstractDataListStyle().TryGetValue("DefaultAbstractDataListTemplate", out var dataListTemplate))
|
||||
{
|
||||
DataListTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(dataListTemplate));
|
||||
}
|
||||
|
||||
if (!new Themes.AbstractButtonStyle().TryGetValue("DefaultAbstractButtonTemplate", out var buttonTemplate))
|
||||
{
|
||||
ButtonTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(buttonTemplate));
|
||||
}
|
||||
|
||||
if (!new Themes.AbstractMultiChoiceUIElementStyle().TryGetValue("DefaultAbstractMultipleChoiceTemplate", out var multiChoiceTemplate))
|
||||
{
|
||||
MultiChoiceTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(multiChoiceTemplate));
|
||||
}
|
||||
|
||||
if (!new Themes.AbstractBooleanStyle().TryGetValue("DefaultAbstractBooleanTemplate", out var booleanTemplate))
|
||||
{
|
||||
BooleanTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(booleanTemplate));
|
||||
}
|
||||
|
||||
if (!new Themes.AbstractProgressUIElementStyle().TryGetValue("DefaultAbstractProgressUIElementTemplate", out var progressTemplate))
|
||||
{
|
||||
ProgressTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(progressTemplate));
|
||||
}
|
||||
|
||||
TextBoxTemplate = (DataTemplate)textBoxTemplate;
|
||||
DataListTemplate = (DataTemplate)dataListTemplate;
|
||||
ButtonTemplate = (DataTemplate)buttonTemplate;
|
||||
MultiChoiceTemplate = (DataTemplate)multiChoiceTemplate;
|
||||
BooleanTemplate = (DataTemplate)booleanTemplate;
|
||||
ProgressTemplate = (DataTemplate)progressTemplate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractUIElementGroup"/>.
|
||||
/// </summary>
|
||||
public DataTemplate? ElementGroupTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractTextBox"/>.
|
||||
/// </summary>
|
||||
public DataTemplate TextBoxTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractDataList"/>.
|
||||
/// </summary>
|
||||
public DataTemplate DataListTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractButton"/>.
|
||||
/// </summary>
|
||||
public DataTemplate ButtonTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractBooleanUIElement"/>.
|
||||
/// </summary>
|
||||
public DataTemplate BooleanTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractProgressUIElement"/>.
|
||||
/// </summary>
|
||||
public DataTemplate ProgressTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractMultiChoiceUIElement"/>.
|
||||
/// </summary>
|
||||
public DataTemplate MultiChoiceTemplate { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (!new Themes.AbstractUIGroupPresenterStyle().TryGetValue("DefaultAbstractUIElementGroupTemplate", out var elementGroupTemplate))
|
||||
ElementGroupTemplate = ThrowHelper.ThrowArgumentNullException<DataTemplate>(nameof(elementGroupTemplate));
|
||||
|
||||
ElementGroupTemplate = (DataTemplate)elementGroupTemplate;
|
||||
|
||||
return item switch
|
||||
{
|
||||
AbstractTextBoxViewModel => TextBoxTemplate,
|
||||
AbstractDataListViewModel => DataListTemplate,
|
||||
AbstractButtonViewModel => ButtonTemplate,
|
||||
AbstractMultiChoiceUIElementViewModel => MultiChoiceTemplate,
|
||||
AbstractBooleanViewModel => BooleanTemplate,
|
||||
AbstractProgressUIElementViewModel => ProgressTemplate,
|
||||
AbstractUIElementGroupViewModel => ElementGroupTemplate,
|
||||
_ => null!
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.ViewModels;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Displays a group of abstract UI elements.
|
||||
/// </summary>
|
||||
public sealed partial class AbstractUIGroupPresenter : Control
|
||||
{
|
||||
private bool _dataContextBeingSet;
|
||||
|
||||
/// <summary>
|
||||
/// Backing property for <see cref="ViewModel"/>.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ViewModelProperty =
|
||||
DependencyProperty.Register(nameof(ViewModel), typeof(AbstractUIElementGroupViewModel), typeof(AbstractUIGroupPresenter), new PropertyMetadata(null, (d, e) => ((AbstractUIGroupPresenter)d).OnViewModelChanged()));
|
||||
|
||||
/// <summary>
|
||||
/// Backing property for <see cref="TemplateSelector"/>.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty TemplateSelectorProperty =
|
||||
DependencyProperty.Register(nameof(TemplateSelector), typeof(DataTemplateSelector), typeof(AbstractUIGroupPresenter), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel for this UserControl.
|
||||
/// </summary>
|
||||
public AbstractUIElementGroupViewModel? ViewModel
|
||||
{
|
||||
get => (AbstractUIElementGroupViewModel)GetValue(ViewModelProperty);
|
||||
set => SetValue(ViewModelProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The template selector used to display Abstract UI elements. Use this to define your own custom styles for each control. You may specify the existing, default styles for those you don't want to override.
|
||||
/// </summary>
|
||||
public DataTemplateSelector? TemplateSelector
|
||||
{
|
||||
get => (DataTemplateSelector)GetValue(TemplateSelectorProperty);
|
||||
set => SetValue(TemplateSelectorProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="AbstractUIGroupPresenter"/>.
|
||||
/// </summary>
|
||||
public AbstractUIGroupPresenter()
|
||||
{
|
||||
this.DefaultStyleKey = typeof(AbstractUIGroupPresenter);
|
||||
|
||||
AttachEvents();
|
||||
}
|
||||
|
||||
private void AttachEvents()
|
||||
{
|
||||
Loaded += OnLoaded;
|
||||
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
}
|
||||
|
||||
private void DetachEvents()
|
||||
{
|
||||
DataContextChanged -= OnDataContextChanged;
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (_dataContextBeingSet)
|
||||
return;
|
||||
|
||||
_dataContextBeingSet = true;
|
||||
|
||||
if (DataContext is AbstractUIElementGroup elementGroup)
|
||||
ViewModel = new AbstractUIElementGroupViewModel(elementGroup);
|
||||
|
||||
if (DataContext is AbstractUIElementGroupViewModel elementGroupViewModel)
|
||||
ViewModel = elementGroupViewModel;
|
||||
|
||||
_dataContextBeingSet = false;
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Loaded -= OnLoaded;
|
||||
Unloaded += OnUnloaded;
|
||||
}
|
||||
|
||||
private void OnUnloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Unloaded -= OnUnloaded;
|
||||
|
||||
DetachEvents();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised when the <see cref="ViewModel"/> changes.
|
||||
/// </summary>
|
||||
public void OnViewModelChanged()
|
||||
{
|
||||
if (_dataContextBeingSet)
|
||||
return;
|
||||
|
||||
_dataContextBeingSet = true;
|
||||
DataContext = ViewModel;
|
||||
_dataContextBeingSet = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="OwlCore.Wpf.AbstractUI.Themes.AbstractBooleanStyle"
|
||||
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:abstractUI="clr-namespace:OwlCore.AbstractUI.ViewModels;assembly=OwlCore"
|
||||
xmlns:convertvis="clr-namespace:OwlCore.Wpf.Converters.Bools.Visible"
|
||||
xmlns:controls="clr-namespace:OwlCore.Wpf.AbstractUI.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractBooleanTemplate" DataType="abstractUI:AbstractBooleanViewModel">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUITitleFontSize}" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" />
|
||||
|
||||
<TextBlock Text="{Binding Subtitle, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUISubtitleFontSize}"
|
||||
FontWeight="{StaticResource DefaultAbstractUISubtitleFontWeight}"
|
||||
Opacity="{StaticResource DefaultAbstractUISubtitleOpacity}"
|
||||
Visibility="{Binding Path=Subtitle, TargetNullValue=Collapsed, Mode=OneWay}"/>
|
||||
|
||||
<CheckBox ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" Content="{Binding Label, Mode=OneWay}" IsChecked="{Binding IsToggled, Mode=TwoWay}">
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="Checked">
|
||||
<behaviors:InvokeCommandAction Command="{Binding ToggledCommand}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<Style TargetType="controls:AbstractBooleanPresenter">
|
||||
<Style.Setters>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:AbstractBooleanPresenter">
|
||||
<ContentControl ContentTemplate="{StaticResource DefaultAbstractBooleanTemplate}"
|
||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Windows;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Default template for the <see cref="AbstractBooleanStyle"/>
|
||||
/// </summary>
|
||||
public sealed partial class AbstractBooleanStyle : ResourceDictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AbstractButtonTemplate"/> class.
|
||||
/// </summary>
|
||||
public AbstractBooleanStyle()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="OwlCore.Wpf.AbstractUI.Themes.AbstractButtonStyle"
|
||||
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:abstractUI="clr-namespace:OwlCore.AbstractUI.ViewModels;assembly=OwlCore"
|
||||
xmlns:convertvis="clr-namespace:OwlCore.Wpf.Converters.Bools.Visible"
|
||||
xmlns:controls="clr-namespace:OwlCore.Wpf.AbstractUI.Controls"
|
||||
xmlns:local="clr-namespace:OwlCore.Wpf.AbstractUI.Themes">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<local:AbstractButtonTemplateSelector x:Key="ButtonStyleSelector">
|
||||
<local:AbstractButtonTemplateSelector.GenericStyle>
|
||||
<Style TargetType="Button"/>
|
||||
</local:AbstractButtonTemplateSelector.GenericStyle>
|
||||
<local:AbstractButtonTemplateSelector.ConfirmStyle>
|
||||
<Style TargetType="Button">
|
||||
<Style.Setters>
|
||||
<Setter Property="Background" Value="{StaticResource SystemControlHighlightAccentBrush}"/>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
</local:AbstractButtonTemplateSelector.ConfirmStyle>
|
||||
<local:AbstractButtonTemplateSelector.DeleteStyle>
|
||||
<Style TargetType="Button">
|
||||
<Style.Setters>
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
</local:AbstractButtonTemplateSelector.DeleteStyle>
|
||||
</local:AbstractButtonTemplateSelector>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractButtonTemplate" DataType="abstractUI:AbstractButtonViewModel">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUITitleFontSize}" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" />
|
||||
|
||||
<TextBlock Text="{Binding Subtitle, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUISubtitleFontSize}"
|
||||
FontWeight="{StaticResource DefaultAbstractUISubtitleFontWeight}"
|
||||
Opacity="{StaticResource DefaultAbstractUISubtitleOpacity}"
|
||||
Visibility="{Binding Path=Subtitle, TargetNullValue=Collapsed, Mode=OneWay}"/>
|
||||
|
||||
<Button Style="{Binding Type, Converter={StaticResource ButtonStyleSelector}, Mode=OneWay}" Command="{Binding ClickCommand}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding IconCode}" FontFamily="Segoe MDL2 Assets" FontSize="16"
|
||||
Grid.Column="0" Margin="0,0,8,0" />
|
||||
<TextBlock Text="{Binding Text}" Grid.Column="1"/>
|
||||
</Grid>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<Style TargetType="controls:AbstractButtonPresenter">
|
||||
<Style.Setters>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:AbstractButtonPresenter">
|
||||
<ContentControl ContentTemplate="{StaticResource DefaultAbstractButtonTemplate}"
|
||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Windows;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Default template for the <see cref="AbstractButtonStyle"/>
|
||||
/// </summary>
|
||||
public sealed partial class AbstractButtonStyle : ResourceDictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AbstractButtonStyle"/> class.
|
||||
/// </summary>
|
||||
public AbstractButtonStyle()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
using OwlCore.AbstractUI.ViewModels;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OwlCore.Wpf.AbstractUI.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects the template that is used for an <see cref="AbstractButton"/> based on the <see cref="AbstractButton.Type"/>.
|
||||
/// </summary>
|
||||
public class AbstractButtonTemplateSelector : IValueConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// The data template used to a display an <see cref="AbstractButton"/> with a generic style.
|
||||
/// </summary>
|
||||
public Style? GenericStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to a display an <see cref="AbstractButton"/> with a confirmation style.
|
||||
/// </summary>
|
||||
public Style? ConfirmStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to a display an <see cref="AbstractButton"/> with a deletion style.
|
||||
/// </summary>
|
||||
public Style? DeleteStyle { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var type = AbstractButtonType.Generic;
|
||||
|
||||
if (value is AbstractButtonType vType)
|
||||
type = vType;
|
||||
if (value is AbstractButtonViewModel buttonViewModel)
|
||||
type = buttonViewModel.Type;
|
||||
else if (value is AbstractButton button)
|
||||
type = button.Type;
|
||||
|
||||
return type switch
|
||||
{
|
||||
AbstractButtonType.Generic => GenericStyle ?? ThrowHelper.ThrowArgumentNullException<Style>(),
|
||||
AbstractButtonType.Confirm => ConfirmStyle ?? GenericStyle ?? ThrowHelper.ThrowArgumentNullException<Style>(),
|
||||
AbstractButtonType.Cancel => DeleteStyle ?? GenericStyle ?? ThrowHelper.ThrowArgumentNullException<Style>(),
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="OwlCore.Wpf.AbstractUI.Themes.AbstractDataListStyle"
|
||||
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:abstractUI="clr-namespace:OwlCore.AbstractUI.ViewModels;assembly=OwlCore"
|
||||
xmlns:convertvis="clr-namespace:OwlCore.Wpf.Converters.Bools.Visible"
|
||||
xmlns:themes="clr-namespace:OwlCore.Wpf.AbstractUI.Themes"
|
||||
xmlns:controls="clr-namespace:OwlCore.Wpf.AbstractUI.Controls"
|
||||
xmlns:converters="clr-namespace:OwlCore.Wpf.Converters">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<convertvis:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||
<convertvis:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisibilityConverter"/>
|
||||
<converters:SelectionChangedEventArgsToClickedItemConverter x:Key="SelectionChangedEventArgsToClickedItemConverter" />
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractDataListListTemplate" DataType="abstractUI:AbstractDataListViewModel">
|
||||
<ListView x:Name="PrimaryListView" ItemsSource="{Binding Items}" SelectionMode="Single" Margin="10">
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="SelectionChanged">
|
||||
<behaviors:InvokeCommandAction Command="{Binding ItemTappedCommand}" EventArgsConverter="{StaticResource SelectionChangedEventArgsToClickedItemConverter}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
<ListView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListView.ItemsPanel>
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
<ContentPresenter />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate DataType="abstractUI:AbstractDataListItemViewModel">
|
||||
<Grid ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" Height="60">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid Visibility="{Binding Parent.IsUserEditingEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Button Content="" FontFamily="Segoe MDL2 Assets" FontSize="16"
|
||||
Height="40" Width="40" Margin="0,0,5,0" Background="Transparent"
|
||||
Visibility="{Binding IsAddItem, Converter={StaticResource InverseBoolToVisibilityConverter}}">
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="Click">
|
||||
<behaviors:InvokeCommandAction Command="{Binding RequestRemoveCommand}" CommandParameter="{Binding}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
<Button Grid.RowSpan="2" Content="" FontFamily="Segoe MDL2 Assets" FontSize="18"
|
||||
Height="40" Width="40" Margin="0,0,5,0" Background="Transparent"
|
||||
Visibility="{Binding IsAddItem, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="Click">
|
||||
<behaviors:InvokeCommandAction Command="{Binding RequestAddCommand}" CommandParameter="{Binding}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Column="1" Grid.RowSpan="2" Margin="0,0,5,0" Visibility="{Binding Path=IconCode, TargetNullValue=Collapsed}"
|
||||
Height="65" Width="60">
|
||||
<TextBlock Text="{Binding IconCode, Mode=OneWay}" FontFamily="Segoe MDL2 Assets" FontSize="42" />
|
||||
</Border>
|
||||
|
||||
<Image Grid.Column="1" Grid.RowSpan="2" Margin="0,0,5,0" Visibility="{Binding ImageSourceIsValid, TargetNullValue=Collapsed}"
|
||||
x:Name="Thumbnail"
|
||||
MaxHeight="60" MaxWidth="60"
|
||||
Source="{Binding ImageSource, Mode=OneWay}" />
|
||||
|
||||
<TextBlock Grid.Column="2" Text="{Binding Title, Mode=OneWay}" FontSize="20" VerticalAlignment="Center"
|
||||
Visibility="{Binding Path=Title, TargetNullValue=Collapsed, Mode=OneWay}"/>
|
||||
|
||||
<TextBlock x:Name="SubtitleTextBlock" Grid.Column="2" Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding Path=Subtitle, TargetNullValue=Collapsed, Mode=OneWay}"
|
||||
Text="{Binding Subtitle, Mode=OneWay}"
|
||||
FontSize="16" FontWeight="Light" Opacity="0.75" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractDataListGridTemplate" DataType="abstractUI:AbstractDataListViewModel">
|
||||
<ListView SelectionMode="Single" ItemsSource="{Binding Items}">
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="SelectionChanged">
|
||||
<behaviors:InvokeCommandAction Command="{Binding ItemTappedCommand}" EventArgsConverter="{StaticResource SelectionChangedEventArgsToClickedItemConverter}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
<Grid x:Name="ContentBorder">
|
||||
<ContentPresenter x:Name="ContentPresenter" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate DataType="abstractUI:AbstractDataListItemViewModel">
|
||||
<Grid ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" Width="150" Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border BorderBrush="White" BorderThickness="1">
|
||||
<Grid Height="150" Width="150" Grid.ColumnSpan="2">
|
||||
<TextBlock Text="{Binding IconCode}" FontFamily="Segoe MDL2 Assets" FontSize="34" />
|
||||
<TextBlock Visibility="{Binding IsAddItem, Converter={StaticResource BoolToVisibilityConverter}}" Text="" FontFamily="Segoe MDL2 Assets" FontSize="34" />
|
||||
<Image Source="{Binding ImageSource, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="16" Grid.Row="1" TextTrimming="CharacterEllipsis" />
|
||||
|
||||
<Border Visibility="{Binding Parent.IsUserEditingEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Button Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Content="" FontFamily="Segoe MDL2 Assets" FontSize="14"
|
||||
Margin="5,-1,0,0" Background="Transparent"
|
||||
Visibility="{Binding IsAddItem, Converter={StaticResource InverseBoolToVisibilityConverter}}">
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="Click">
|
||||
<behaviors:InvokeCommandAction Command="{Binding RequestRemoveCommand}" CommandParameter="{Binding}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
</Button>
|
||||
</Border>
|
||||
|
||||
<TextBlock x:Name="SubtitleTextBlock" Grid.Row="2" Grid.ColumnSpan="2"
|
||||
Text="{Binding Subtitle}"
|
||||
FontSize="12" FontWeight="Light" Opacity="0.5" TextTrimming="CharacterEllipsis" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractDataListTemplate" DataType="abstractUI:AbstractDataListViewModel">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Title, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUITitleFontSize}" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}" />
|
||||
|
||||
<TextBlock Text="{Binding Subtitle, Mode=OneWay}" FontSize="{StaticResource DefaultAbstractUISubtitleFontSize}"
|
||||
FontWeight="{StaticResource DefaultAbstractUISubtitleFontWeight}"
|
||||
Opacity="{StaticResource DefaultAbstractUISubtitleOpacity}"
|
||||
Visibility="{Binding Path=Subtitle, TargetNullValue=Collapsed, Mode=OneWay}"/>
|
||||
|
||||
<ContentControl Content="{Binding}">
|
||||
<ContentControl.ContentTemplateSelector>
|
||||
<themes:AbstractDataListTypeTemplateSelector ListTemplate="{StaticResource DefaultAbstractDataListListTemplate}"
|
||||
GridTemplate="{StaticResource DefaultAbstractDataListGridTemplate}"/>
|
||||
</ContentControl.ContentTemplateSelector>
|
||||
</ContentControl>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<Style TargetType="controls:AbstractDataListPresenter">
|
||||
<Style.Setters>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:AbstractDataListPresenter">
|
||||
<ContentControl ContentTemplate="{StaticResource DefaultAbstractDataListTemplate}"
|
||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Windows;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Default template for the <see cref="AbstractDataList"/>
|
||||
/// </summary>
|
||||
public sealed partial class AbstractDataListStyle : ResourceDictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AbstractDataListStyle"/> class.
|
||||
/// </summary>
|
||||
public AbstractDataListStyle()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.ViewModels;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects the template that is used for an <see cref="AbstractDataList"/> based on the <see cref="AbstractDataList.PreferredDisplayMode"/>.
|
||||
/// </summary>
|
||||
public class AbstractDataListTypeTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractTextBox"/>.
|
||||
/// </summary>
|
||||
public DataTemplate? GridTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractDataList"/>.
|
||||
/// </summary>
|
||||
public DataTemplate? ListTemplate { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item is AbstractDataListViewModel viewModel)
|
||||
{
|
||||
return viewModel.PreferredDisplayMode switch
|
||||
{
|
||||
AbstractDataListPreferredDisplayMode.Grid => GridTemplate ?? ThrowHelper.ThrowArgumentNullException<DataTemplate>(),
|
||||
AbstractDataListPreferredDisplayMode.List => ListTemplate ?? ThrowHelper.ThrowArgumentNullException<DataTemplate>(),
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
}
|
||||
|
||||
return null!;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using OwlCore.AbstractUI.ViewModels;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects the template that is used for an <see cref="AbstractDataList"/> based on the <see cref="AbstractDataList.PreferredDisplayMode"/>.
|
||||
/// </summary>
|
||||
public class AbstractMultiChoiceTypeTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractTextBox"/>.
|
||||
/// </summary>
|
||||
public DataTemplate? ComboBoxTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data template used to display an <see cref="AbstractDataList"/>.
|
||||
/// </summary>
|
||||
public DataTemplate? RadioButtonTemplate { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item is AbstractMultiChoiceUIElementViewModel viewModel)
|
||||
{
|
||||
return viewModel.PreferredDisplayMode switch
|
||||
{
|
||||
AbstractMultiChoicePreferredDisplayMode.Dropdown => ComboBoxTemplate ?? ThrowHelper.ThrowArgumentNullException<DataTemplate>(),
|
||||
AbstractMultiChoicePreferredDisplayMode.RadioButtons => RadioButtonTemplate ?? ThrowHelper.ThrowArgumentNullException<DataTemplate>(),
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
}
|
||||
|
||||
return null!;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="OwlCore.Wpf.AbstractUI.Themes.AbstractMultiChoiceUIElementStyle"
|
||||
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:abstractUI="clr-namespace:OwlCore.AbstractUI.ViewModels;assembly=OwlCore"
|
||||
xmlns:convertvis="clr-namespace:OwlCore.Wpf.Converters.Bools.Visible"
|
||||
xmlns:controls="clr-namespace:OwlCore.Wpf.AbstractUI.Controls"
|
||||
xmlns:themes="clr-namespace:OwlCore.Wpf.AbstractUI.Themes">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractMultipleChoiceComboBoxTemplate" DataType="abstractUI:AbstractMultiChoiceUIElementViewModel">
|
||||
<ComboBox ItemsSource="{Binding Items}" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="abstractUI:AbstractMultiChoiceItemViewModel">
|
||||
<TextBlock Text="{Binding Title}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
<behaviors:Interaction.Triggers>
|
||||
<behaviors:EventTrigger EventName="SelectionChanged">
|
||||
<behaviors:InvokeCommandAction Command="{Binding ItemSelectedCommand}" />
|
||||
</behaviors:EventTrigger>
|
||||
</behaviors:Interaction.Triggers>
|
||||
</ComboBox>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractMultipleChoiceRadioButtonTemplate" DataType="abstractUI:AbstractMultiChoiceUIElementViewModel">
|
||||
<ItemsControl ItemsSource="{Binding Items}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="abstractUI:AbstractMultiChoiceItemViewModel">
|
||||
<RadioButton Command="{Binding ItemSelectedCommand}" Content="{Binding Title}" GroupName="{Binding GroupId}" IsChecked="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="DefaultAbstractMultipleChoiceTemplate" DataType="abstractUI:AbstractMultiChoiceUIElementViewModel">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Title}" FontSize="{StaticResource DefaultAbstractUITitleFontSize}" ToolTipService.ToolTip="{Binding TooltipText}" />
|
||||
|
||||
<TextBlock Text="{Binding Subtitle}" FontSize="{StaticResource DefaultAbstractUISubtitleFontSize}"
|
||||
FontWeight="{StaticResource DefaultAbstractUISubtitleFontWeight}"
|
||||
Opacity="{StaticResource DefaultAbstractUISubtitleOpacity}"
|
||||
Visibility="{Binding Path=Subtitle, TargetNullValue=Collapsed}"/>
|
||||
|
||||
<ContentControl Content="{Binding}" Margin="0,5,0,0">
|
||||
<ContentControl.ContentTemplateSelector>
|
||||
<themes:AbstractMultiChoiceTypeTemplateSelector ComboBoxTemplate="{StaticResource DefaultAbstractMultipleChoiceComboBoxTemplate}"
|
||||
RadioButtonTemplate="{StaticResource DefaultAbstractMultipleChoiceRadioButtonTemplate}"/>
|
||||
</ContentControl.ContentTemplateSelector>
|
||||
</ContentControl>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<Style TargetType="controls:AbstractMultiChoicePresenter">
|
||||
<Style.Setters>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:AbstractMultiChoicePresenter">
|
||||
<ContentControl ContentTemplate="{StaticResource DefaultAbstractMultipleChoiceTemplate}"
|
||||
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Windows;
|
||||
using OwlCore.AbstractUI.Models;
|
||||
|
||||
namespace OwlCore.Wpf.AbstractUI.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// Default template for the <see cref="AbstractDataList"/>
|
||||
/// </summary>
|
||||
public sealed partial class AbstractMultiChoiceUIElementStyle : ResourceDictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AbstractMultiChoiceUIElementStyle"/> class.
|
||||
/// </summary>
|
||||
public AbstractMultiChoiceUIElementStyle()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user