mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-06-30 01:40:51 +02:00
removed warnings
This commit is contained in:
@ -5,7 +5,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts enums to a List with KeyValuePairs.
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for <see cref="MagicSymbolControl"/>
|
||||
|
@ -1,5 +1,4 @@
|
||||
using LsBricks.ElementMVVM.Types;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
@ -9,7 +8,7 @@ using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <summary>
|
||||
/// Magically converts a text to
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects the right template on base of value-type.
|
||||
|
@ -1,10 +1,10 @@
|
||||
<ContentControl
|
||||
x:Class="LsBricks.Controls.PropertyPresenter2"
|
||||
x:Class="ModernWpfPlayground.PropertyPresenter2.PropertyPresenter2"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:LsBricks.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:propertyPresenter2="clr-namespace:ModernWpfPlayground.PropertyPresenter2"
|
||||
x:Name="LayoutRoot"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="300"
|
||||
@ -16,13 +16,13 @@
|
||||
<ContentControl.Resources>
|
||||
<DataTemplate x:Key="DefaultDataTemplate">
|
||||
<Grid>
|
||||
<controls:TextBoxEx
|
||||
<propertyPresenter2:TextBoxEx
|
||||
x:Name="InputTextBox"
|
||||
Text="{Binding Value, ElementName=LayoutRoot}"
|
||||
Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}"
|
||||
Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}">
|
||||
<TextBox.Style>
|
||||
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type controls:TextBoxEx}">
|
||||
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type propertyPresenter2:TextBoxEx}">
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="UpdateBindingOnEnter" Value="False" />
|
||||
<Style.Triggers>
|
||||
@ -38,7 +38,7 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBox.Style>
|
||||
</controls:TextBoxEx>
|
||||
</propertyPresenter2:TextBoxEx>
|
||||
<TextBlock
|
||||
Margin="6,0,0,0"
|
||||
Padding="2,2,2,2"
|
||||
@ -86,7 +86,7 @@
|
||||
</CheckBox.Style>
|
||||
</CheckBox>
|
||||
</DataTemplate>
|
||||
<controls:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" />
|
||||
<propertyPresenter2:EnumToKeyValueListConverter x:Key="EnumToKeyValuePairConverter" />
|
||||
<DataTemplate x:Key="EnumComboBoxDataTemplate">
|
||||
<ComboBox
|
||||
DisplayMemberPath="Key"
|
||||
@ -112,7 +112,7 @@
|
||||
</ComboBox.Style>
|
||||
</ComboBox>
|
||||
</DataTemplate>
|
||||
<controls:PropertyDataTemplateSelector
|
||||
<propertyPresenter2:PropertyDataTemplateSelector
|
||||
x:Key="DataTemplateSelector"
|
||||
BooleanDataTemplate="{StaticResource BooleanDataTemplate}"
|
||||
DefaultDataTemplate="{StaticResource DefaultDataTemplate}"
|
||||
@ -152,7 +152,7 @@
|
||||
VerticalAlignment="Center"
|
||||
Focusable="False"
|
||||
Text="{Binding Label, ElementName=LayoutRoot}" />
|
||||
<controls:MagicSymbolControl
|
||||
<propertyPresenter2:MagicSymbolControl
|
||||
x:Name="PartSymbol"
|
||||
Grid.Column="2"
|
||||
Margin="5,0"
|
||||
|
@ -3,7 +3,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <inheritdoc cref="ContentControl" />
|
||||
/// <summary>
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
@ -38,7 +38,7 @@ namespace LsBricks.Controls
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:LsBricks.Controls.TextBoxEx" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:ModernWpfPlayground.PropertyPresenter2.TextBoxEx" /> class.
|
||||
/// </summary>
|
||||
public TextBoxEx()
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace LsBricks.ElementMVVM.Types
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <summary>
|
||||
/// A component of the symbol
|
||||
|
@ -11,7 +11,7 @@ using Brushes = System.Windows.Media.Brushes;
|
||||
using FontFamily = System.Windows.Media.FontFamily;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
namespace LsBricks.Controls
|
||||
namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
/// <summary>
|
||||
/// Makes an Bitmap from every Imageformat.
|
||||
@ -97,28 +97,4 @@ namespace LsBricks.Controls
|
||||
/// <inheritdoc />
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// negate double converter
|
||||
/// </summary>
|
||||
[ValueConversion(typeof(double), typeof(double))]
|
||||
public class NegateDoubleConverter : IValueConverter
|
||||
{
|
||||
/// <summary>Converts a value. </summary>
|
||||
/// <returns>A converted value. If the method returns null, the valid null value is used.</returns>
|
||||
/// <param name="value">The value produced by the binding source.</param>
|
||||
/// <param name="targetType">The type of the binding target property.</param>
|
||||
/// <param name="parameter">The converter parameter to use.</param>
|
||||
/// <param name="culture">The culture to use in the converter.</param>
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
|
||||
value is double d ? -d : throw new ArgumentException(nameof(value) + " is not a doubles");
|
||||
|
||||
/// <summary>Converts a value. </summary>
|
||||
/// <returns>A converted value. If the method returns null, the valid null value is used.</returns>
|
||||
/// <param name="value">The value that is produced by the binding target.</param>
|
||||
/// <param name="targetType">The type to convert to.</param>
|
||||
/// <param name="parameter">The converter parameter to use.</param>
|
||||
/// <param name="culture">The culture to use in the converter.</param>
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => Binding.DoNothing;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user