Skip to content

Commit

Permalink
Kill the everything marked as obsolete with 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
flagbug committed Aug 20, 2014
1 parent 9a95244 commit d4ec4d4
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 352 deletions.
2 changes: 1 addition & 1 deletion MahApps.Metro/Accent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace MahApps.Metro
{
/// <summary>
/// An object that represents the foreground color for a Metro <see cref="Theme"/>.
/// An object that represents the foreground color for a Metro <see cref="AppTheme"/>.
/// </summary>
[DebuggerDisplay("accent={Name}, res={Resources.Source}")]
public class Accent
Expand Down
10 changes: 0 additions & 10 deletions MahApps.Metro/Theme.cs → MahApps.Metro/AppTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

namespace MahApps.Metro
{
/// <summary>
/// An enum that represents the two Metro styles: Light and Dark.
/// </summary>
[Obsolete("This class is obsolete and no longer used")]
public enum Theme
{
Light,
Dark
}

/// <summary>
/// Represents the background theme of the application.
/// </summary>
Expand Down
30 changes: 0 additions & 30 deletions MahApps.Metro/Behaviours/BorderlessWindowBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,35 +347,5 @@ public bool EnableDWMDropShadow
get { return (bool)GetValue(EnableDWMDropShadowProperty); }
set { SetValue(EnableDWMDropShadowProperty, value); }
}

[Obsolete("This property is obsolete and will be removed in next release.")]
public static readonly DependencyProperty AllowsTransparencyProperty = DependencyProperty.Register("AllowsTransparency", typeof(bool), typeof(BorderlessWindowBehavior), new PropertyMetadata(false));

[Obsolete("This property is obsolete and will be removed in next release.")]
public bool AllowsTransparency
{
get { return (bool)GetValue(AllowsTransparencyProperty); }
set { SetValue(AllowsTransparencyProperty, value); }
}

[Obsolete("This property is obsolete and will be removed in next release (use Window.ResizeMode instead to handle this).")]
public static readonly DependencyProperty ResizeWithGripProperty = DependencyProperty.Register("ResizeWithGrip", typeof(bool), typeof(BorderlessWindowBehavior), new PropertyMetadata(true));

[Obsolete("This property is obsolete and will be removed in next release (use Window.ResizeMode to handle this).")]
public bool ResizeWithGrip
{
get { return (bool)GetValue(ResizeWithGripProperty); }
set { SetValue(ResizeWithGripProperty, value); }
}

[Obsolete("This property is obsolete and will be removed in next release (use Window.AutoSizeToContent instead to handle this).")]
public static readonly DependencyProperty AutoSizeToContentProperty = DependencyProperty.Register("AutoSizeToContent", typeof(bool), typeof(BorderlessWindowBehavior), new PropertyMetadata(false));

[Obsolete("This property is obsolete and will be removed in next release (use Window.AutoSizeToContent instead to handle this).")]
public bool AutoSizeToContent
{
get { return (bool)GetValue(AutoSizeToContentProperty); }
set { SetValue(AutoSizeToContentProperty, value); }
}
}
}
13 changes: 0 additions & 13 deletions MahApps.Metro/Controls/Dialogs/BaseMetroDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,19 +307,6 @@ public MetroDialogSettings()
/// </summary>
public MetroDialogColorScheme ColorScheme { get; set; }

/// <summary>
/// Enable/disable dialog showing/hiding animations.
/// Setting this value will also set both AnimateShow and AnimateHide properties to the same value.
/// Getting "True" - at least AnimateHide or AnimateHide is "True".
/// Getting "False" - both AnimateHide and AnimateHide are "False".
/// </summary>
[Obsolete("This property is obsolete and will be deleted in next release, use AnimateShow and AnimateHide instead.")]
public bool UseAnimations
{
get { return AnimateShow || AnimateHide; }
set { AnimateShow = AnimateHide = value; }
}

/// <summary>
/// Enable/disable dialog showing animation.
/// "True" - play showing animation.
Expand Down
42 changes: 4 additions & 38 deletions MahApps.Metro/Controls/MetroWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ public class MetroWindow : Window

public static readonly DependencyProperty LeftWindowCommandsProperty = DependencyProperty.Register("LeftWindowCommands", typeof(WindowCommands), typeof(MetroWindow), new PropertyMetadata(null));
public static readonly DependencyProperty RightWindowCommandsProperty = DependencyProperty.Register("RightWindowCommands", typeof(WindowCommands), typeof(MetroWindow), new PropertyMetadata(null));
[Obsolete("This property is obsolete and will be delete in next release, use RightWindowCommands instead.")]
public static readonly DependencyProperty WindowCommandsProperty = DependencyProperty.Register("WindowCommands", typeof(WindowCommands), typeof(MetroWindow), new PropertyMetadata(null, WindowCommandsPropertyChangedCallback));
[Obsolete("This property is obsolete. Use the WindowCommandsBehaviorProperty flags instead.")]
public static readonly DependencyProperty ShowWindowCommandsOnTopProperty = DependencyProperty.Register("ShowWindowCommandsOnTop", typeof(bool), typeof(MetroWindow), new PropertyMetadata(true));

public static readonly DependencyProperty LeftWindowCommandsOverlayBehaviorProperty = DependencyProperty.Register("LeftWindowCommandsOverlayBehavior", typeof(WindowCommandsOverlayBehavior), typeof(MetroWindow), new PropertyMetadata(WindowCommandsOverlayBehavior.Always));
public static readonly DependencyProperty RightWindowCommandsOverlayBehaviorProperty = DependencyProperty.Register("RightWindowCommandsOverlayBehavior", typeof(WindowCommandsOverlayBehavior), typeof(MetroWindow), new PropertyMetadata(WindowCommandsOverlayBehavior.Always));
Expand All @@ -83,8 +79,6 @@ public class MetroWindow : Window
public static readonly DependencyProperty WindowMaxButtonStyleProperty = DependencyProperty.Register("WindowMaxButtonStyle", typeof(Style), typeof(MetroWindow), new PropertyMetadata(null));
public static readonly DependencyProperty WindowCloseButtonStyleProperty = DependencyProperty.Register("WindowCloseButtonStyle", typeof(Style), typeof(MetroWindow), new PropertyMetadata(null));

[Obsolete("This propery isn't needed anymore, it will be deleted in next release...")]
public static readonly DependencyProperty TextBlockStyleProperty = DependencyProperty.Register("TextBlockStyle", typeof(Style), typeof(MetroWindow), new PropertyMetadata(default(Style)));
public static readonly DependencyProperty UseNoneWindowStyleProperty = DependencyProperty.Register("UseNoneWindowStyle", typeof(bool), typeof(MetroWindow), new PropertyMetadata(false, OnUseNoneWindowStylePropertyChangedCallback));
public static readonly DependencyProperty OverrideDefaultWindowCommandsBrushProperty = DependencyProperty.Register("OverrideDefaultWindowCommandsBrush", typeof(SolidColorBrush), typeof(MetroWindow));

Expand Down Expand Up @@ -127,30 +121,12 @@ public MetroDialogSettings MetroDialogOptions
set { SetValue(MetroDialogOptionsProperty, value); }
}


[Obsolete("This propery isn't needed anymore, it will be deleted in next release...")]
public Style TextBlockStyle
{
get { return (Style)this.GetValue(TextBlockStyleProperty); }
set { SetValue(TextBlockStyleProperty, value); }
}

public bool EnableDWMDropShadow
{
get { return (bool)GetValue(EnableDWMDropShadowProperty); }
set { SetValue(EnableDWMDropShadowProperty, value); }
}

/// <summary>
/// Gets/sets whether the Window Commands will show on top of a Flyout with it's position set to Top or Right.
/// </summary>
[Obsolete("This property is obsolete. Use the WindowCommandOverlayBehavior flags instead.")]
public bool ShowWindowCommandsOnTop
{
get { return (bool)this.GetValue(ShowWindowCommandsOnTopProperty); }
set { SetValue(ShowWindowCommandsOnTopProperty, value); }
}

public WindowCommandsOverlayBehavior LeftWindowCommandsOverlayBehavior
{
get { return (WindowCommandsOverlayBehavior)this.GetValue(LeftWindowCommandsOverlayBehaviorProperty); }
Expand Down Expand Up @@ -256,16 +232,6 @@ public WindowCommands RightWindowCommands
set { SetValue(RightWindowCommandsProperty, value); }
}

/// <summary>
/// Gets/sets the right window commands that hosts the user commands.
/// </summary>
[Obsolete("This property is obsolete and will be delete in next release, use RightWindowCommands instead.")]
public WindowCommands WindowCommands
{
get { return (WindowCommands)GetValue(WindowCommandsProperty); }
set { SetValue(WindowCommandsProperty, value); }
}

private static void WindowCommandsPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue != e.OldValue && e.NewValue != null)
Expand Down Expand Up @@ -952,25 +918,25 @@ internal void HandleFlyoutStatusChange(Flyout flyout, IEnumerable<Flyout> visibl
if (icon != null)
{
icon.SetValue(Panel.ZIndexProperty,
this.IconOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) && this.ShowWindowCommandsOnTop ? zIndex : 1);
this.IconOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) ? zIndex : 1);
}

if (LeftWindowCommandsPresenter != null)
{
LeftWindowCommandsPresenter.SetValue(Panel.ZIndexProperty,
this.LeftWindowCommandsOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) && this.ShowWindowCommandsOnTop ? zIndex : 1);
this.LeftWindowCommandsOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) ? zIndex : 1);
}

if (RightWindowCommandsPresenter != null)
{
RightWindowCommandsPresenter.SetValue(Panel.ZIndexProperty,
this.RightWindowCommandsOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) && this.ShowWindowCommandsOnTop ? zIndex : 1);
this.RightWindowCommandsOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) ? zIndex : 1);
}

if (WindowButtonCommands != null)
{
WindowButtonCommands.SetValue(Panel.ZIndexProperty,
this.WindowButtonCommandsOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) && this.ShowWindowCommandsOnTop ? zIndex : 1);
this.WindowButtonCommandsOverlayBehavior.HasFlag(WindowCommandsOverlayBehavior.Flyouts) ? zIndex : 1);
}

this.HandleWindowCommandsForFlyouts(visibleFlyouts);
Expand Down
6 changes: 3 additions & 3 deletions MahApps.Metro/MahApps.Metro.NET45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="Accent.cs" />
<Compile Include="Actions\CloseTabItemAction.cs" />
<Compile Include="Actions\SetFlyoutOpenAction.cs" />
<Compile Include="AppTheme.cs" />
<Compile Include="Behaviours\BindableResourceBehavior.cs" />
<Compile Include="Behaviours\BorderlessWindowBehavior.cs" />
<Compile Include="Behaviours\GlowWindowBehavior.cs" />
Expand Down Expand Up @@ -199,7 +200,6 @@
<SubType>Code</SubType>
</Compile>
<!--<Compile Include="Properties\CommonAssemblyInfo.cs" Condition="EXISTS('Properties\CommonAssemblyInfo.cs')" />-->
<Compile Include="Theme.cs" />
<Compile Include="ThemeManager.cs" />
<AppDesigner Include="Properties\" />
<Page Include="Controls\GlowWindow.xaml">
Expand Down Expand Up @@ -413,9 +413,9 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\ValidationToolTipTemplate.xaml">
<SubType>Designer</SubType>
<Page Include="Styles\ValidationErrorTemplate.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\VS\Button.xaml">
<SubType>Designer</SubType>
Expand Down
4 changes: 2 additions & 2 deletions MahApps.Metro/MahApps.Metro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<Compile Include="Native\UnsafeNativeMethods.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<!--<Compile Include="Properties\CommonAssemblyInfo.cs" Condition="EXISTS('Properties\CommonAssemblyInfo.cs')" />-->
<Compile Include="Theme.cs" />
<Compile Include="AppTheme.cs" />
<Compile Include="ThemeManager.cs" />
<AppDesigner Include="Properties\" />
<Page Include="Controls\GlowWindow.xaml">
Expand Down Expand Up @@ -406,7 +406,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\ValidationToolTipTemplate.xaml">
<Page Include="Styles\ValidationErrorTemplate.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
5 changes: 0 additions & 5 deletions MahApps.Metro/Styles/Controls.Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,6 @@
Value="0" />
</Style>

<!-- obsolete, will be deleted in 0.14 -->
<Style x:Key="IronicallyNamedChromelessButtonStyle"
TargetType="{x:Type Button}"
BasedOn="{StaticResource MetroBaseWindowButtonStyle}" />

<!-- style for default button -->
<Style TargetType="{x:Type Button}"
x:Key="MetroButton">
Expand Down
2 changes: 1 addition & 1 deletion MahApps.Metro/Styles/Controls.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Sizes.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Page.xaml" />

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/ValidationToolTipTemplate.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/ValidationErrorTemplate.xaml" />

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Scrollbars.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.ListView.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,110 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MahApps.Metro.Controls">

<!-- is obsolete -->
<ControlTemplate x:Key="ValidationToolTipTemplate">
<Grid x:Name="Root"
Margin="5,0"
Opacity="0"
RenderTransformOrigin="0,0">
<Grid.RenderTransform>
<TranslateTransform x:Name="xform"
X="-25" />
</Grid.RenderTransform>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="OpenStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0" />
<VisualTransition GeneratedDuration="0:0:0.2"
To="Open">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
Storyboard.TargetName="xform">
<SplineDoubleKeyFrame KeyTime="0:0:0.2"
Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="Root">
<SplineDoubleKeyFrame KeyTime="0:0:0.2"
Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Closed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="Root">
<SplineDoubleKeyFrame KeyTime="0"
Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Open">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
Storyboard.TargetName="xform">
<SplineDoubleKeyFrame KeyTime="0"
Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="Root">
<SplineDoubleKeyFrame KeyTime="0"
Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border Background="{DynamicResource ValidationBrush1}"
CornerRadius="5"
Margin="4,4,-4,-4" />
<Border Background="{DynamicResource ValidationBrush2}"
CornerRadius="4"
Margin="3,3,-3,-3" />
<Border Background="{DynamicResource ValidationBrush3}"
CornerRadius="3"
Margin="2,2,-2,-2" />
<Border Background="{DynamicResource ValidationBrush4}"
CornerRadius="2"
Margin="1,1,-1,-1" />
<Border Background="{DynamicResource ValidationBrush5}"
CornerRadius="2">
<!--
from Josh Smith
Binding to (Validation.Errors)[0] without Creating Debug Spew
http://joshsmithonwpf.wordpress.com/2008/10/08/binding-to-validationerrors0-without-creating-debug-spew/
The trick is to bind a ContentPresenter’s Content to the CurrentItem of Validation.Errors for the target element.
Binding to the CurrentItem means that we’re binding to the CurrentItem property of the default ICollectionView
that wraps the ReadOnlyObservableCollection<ValidationError> returned by the attached Errors property.
When the current item is non-null, that means there is a validation error; when it is null, there are no validation errors.
We can rely on ICollectionView to safely access the validation error, or not return anything if there are no errors.
That is what prevents the debug spew from pouring out.
The DataTemplate declared in the StackPanel’s Resources knows how to render a ValidationError object.
If the ContentPresenter has a null value, the template is not used to render anything.
Issue #707
-->
<Border.Resources>
<DataTemplate DataType="{x:Type ValidationError}">
<TextBlock Foreground="{DynamicResource ValidationTextBrush}"
MaxWidth="250"
Margin="8,4,8,4"
TextWrapping="Wrap"
Text="{Binding ErrorContent}"
UseLayoutRounding="false" />
</DataTemplate>
</Border.Resources>
<ContentPresenter Content="{Binding (Validation.Errors).CurrentItem}" />
</Border>
</Grid>
</ControlTemplate>

<ControlTemplate x:Key="ValidationErrorTemplate">
<AdornedElementPlaceholder x:Name="placeholder">
<Grid SnapsToDevicePixels="True">
Expand Down
Loading

0 comments on commit d4ec4d4

Please sign in to comment.