removed obsolete code from controls

This commit is contained in:
Nikola Metulev 2018-04-15 23:11:13 -07:00
Родитель 6d49f60ea7
Коммит b64d9fbcaf
11 изменённых файлов: 1 добавлений и 211 удалений

Просмотреть файл

@ -27,12 +27,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// </summary>
public static readonly DependencyProperty TitleBarVisibilityProperty = DependencyProperty.Register(nameof(TitleBarVisibility), typeof(Visibility), typeof(BladeItem), new PropertyMetadata(default(Visibility)));
/// <summary>
/// Identifies the <see cref="Title"/> dependency property.
/// </summary>
[Obsolete("Use the Header property instead. This property will be removed in a future major release.")]
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(nameof(Title), typeof(string), typeof(BladeItem), new PropertyMetadata(default(string), OnTitleChanged));
/// <summary>
/// Identifies the <see cref="TitleBarBackground"/> dependency property.
/// </summary>
@ -48,12 +42,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// </summary>
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(nameof(IsOpen), typeof(bool), typeof(BladeItem), new PropertyMetadata(true, IsOpenChangedCallback));
/// <summary>
/// Identifies the <see cref="TitleBarForeground"/> dependency property
/// </summary>
[Obsolete("Use the HeaderTemplate property instead. This property will be removed in a future major release.")]
public static readonly DependencyProperty TitleBarForegroundProperty = DependencyProperty.Register(nameof(TitleBarForeground), typeof(Brush), typeof(BladeItem), new PropertyMetadata(new SolidColorBrush(Colors.Black)));
/// <summary>
/// Identifies the <see cref="CloseButtonForeground"/> dependency property
/// </summary>
@ -68,16 +56,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
set { SetValue(CloseButtonForegroundProperty, value); }
}
/// <summary>
/// Gets or sets the titlebar foreground color
/// </summary>
[Obsolete("Use the HeaderTemplate property instead. This property will be removed in a future major release.")]
public Brush TitleBarForeground
{
get { return (Brush)GetValue(TitleBarForegroundProperty); }
set { SetValue(TitleBarForegroundProperty, value); }
}
/// <summary>
/// Gets or sets the visibility of the title bar for this blade
/// </summary>
@ -87,16 +65,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
set { SetValue(TitleBarVisibilityProperty, value); }
}
/// <summary>
/// Gets or sets the title to appear in the title bar
/// </summary>
[Obsolete("Use the Header property instead. This property will be removed in a future major release.")]
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
/// <summary>
/// Gets or sets the background color of the title bar
/// </summary>
@ -130,13 +98,5 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
bladeItem.Visibility = bladeItem.IsOpen ? Visibility.Visible : Visibility.Collapsed;
bladeItem.VisibilityChanged?.Invoke(bladeItem, bladeItem.Visibility);
}
private static void OnTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
BladeItem bladeItem = (BladeItem)d;
#pragma warning disable CS0618 // Type or member is obsolete
bladeItem.Header = bladeItem.Title;
#pragma warning restore CS0618 // Type or member is obsolete
}
}
}

Просмотреть файл

@ -85,7 +85,6 @@
<Style TargetType="controls:BladeItem">
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="TitleBarForeground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="CloseButtonForeground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
@ -143,8 +142,7 @@
<ContentPresenter x:Name="TitleBar"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
Foreground="{TemplateBinding TitleBarForeground}"/>
ContentTemplate="{TemplateBinding HeaderTemplate}"/>
<Button Name="EnlargeButton"
Grid.Column="1"
TabIndex="0"

Просмотреть файл

@ -30,14 +30,4 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// </summary>
public bool IsItemOptions { get; internal set; }
}
/// <summary>
/// EventArgs used for the <see cref="HamburgerMenu"/> ItemInvoked event
/// </summary>
[Obsolete("The HamburgetMenuItemInvokedEventArgs will be removed caused by a typo. Please use the HamburgerMenuItemInvokedEventArgs instead.")]
#pragma warning disable SA1402 // File may only contain a single class
public class HamburgetMenuItemInvokedEventArgs : HamburgerMenuItemInvokedEventArgs
#pragma warning restore SA1402 // File may only contain a single class
{
}
}

Просмотреть файл

@ -59,18 +59,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// <returns><see cref="CompositionBrush"/></returns>
public abstract CompositionBrush GetAlphaMask();
/// <summary>
/// Event raised if the image failed loading.
/// </summary>
[Obsolete("This event is obsolete; use ImageExFailed event instead")]
public event ExceptionRoutedEventHandler ImageFailed;
/// <summary>
/// Event raised when the image is successfully loaded and opened.
/// </summary>
[Obsolete("This event is obsolete; use ImageExOpened event instead")]
public event RoutedEventHandler ImageOpened;
/// <summary>
/// Event raised if the image failed loading.
/// </summary>

Просмотреть файл

@ -201,14 +201,12 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void OnImageOpened(object sender, RoutedEventArgs e)
{
ImageOpened?.Invoke(this, e);
ImageExOpened?.Invoke(this, new ImageExOpenedEventArgs());
VisualStateManager.GoToState(this, LoadedState, true);
}
private void OnImageFailed(object sender, ExceptionRoutedEventArgs e)
{
ImageFailed?.Invoke(this, e);
ImageExFailed?.Invoke(this, new ImageExFailedEventArgs(new Exception(e.ErrorMessage)));
VisualStateManager.GoToState(this, FailedState, true);
}

Просмотреть файл

@ -30,12 +30,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// </summary>
public event EventHandler Opened;
/// <summary>
/// Event raised when the notification is dismissed
/// </summary>
[Obsolete("Use Closed event instead.")]
public event EventHandler Dismissed;
/// <summary>
/// Event raised when the notification is closing
/// </summary>
@ -67,7 +61,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void DismissAnimationTimer_Tick(object sender, object e)
{
_animationTimer.Stop();
Dismissed?.Invoke(this, EventArgs.Empty);
Closed?.Invoke(this, new InAppNotificationClosedEventArgs(_lastDismissKind));
_animationTimer.Tick -= DismissAnimationTimer_Tick;
}

Просмотреть файл

@ -109,20 +109,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
public static readonly DependencyProperty TickBrushProperty =
DependencyProperty.Register(nameof(TickBrush), typeof(SolidColorBrush), typeof(RadialGauge), new PropertyMetadata(new SolidColorBrush(Colors.White), OnFaceChanged));
/// <summary>
/// Identifies the ValueBrush dependency property.
/// </summary>
[Obsolete("This property has been deprecated. Use the Foreground property or the RadialGaugeForegroundBrush ThemeResource instead")]
public static readonly DependencyProperty ValueBrushProperty =
DependencyProperty.Register(nameof(ValueBrush), typeof(Brush), typeof(RadialGauge), new PropertyMetadata(new SolidColorBrush(Colors.White), OnValueBrushChanged));
/// <summary>
/// Identifies the UnitBrush dependency property.
/// </summary>
[Obsolete("This property has been deprecated. Use the RadialGaugeAccentBrush ThemeResource instead")]
public static readonly DependencyProperty UnitBrushProperty =
DependencyProperty.Register(nameof(UnitBrush), typeof(Brush), typeof(RadialGauge), new PropertyMetadata(new SolidColorBrush(Colors.White), OnUnitBrushChanged));
/// <summary>
/// Identifies the ValueStringFormat dependency property.
/// </summary>
@ -347,26 +333,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
set { SetValue(TickBrushProperty, value); }
}
/// <summary>
/// Gets or sets the brush for the displayed value.
/// </summary>
[Obsolete("This property has been depracated. Use the Foreground property or the RadialGaugeForegroundBrush ThemeResource instead")]
public Brush ValueBrush
{
get { return (Brush)GetValue(ValueBrushProperty); }
set { SetValue(ValueBrushProperty, value); }
}
/// <summary>
/// Gets or sets the brush for the displayed unit measure.
/// </summary>
[Obsolete("This property has been depracated. Use the RadialGaugeAccentBrush ThemeResource instead")]
public Brush UnitBrush
{
get { return (Brush)GetValue(UnitBrushProperty); }
set { SetValue(UnitBrushProperty, value); }
}
/// <summary>
/// Gets or sets the value string format.
/// </summary>
@ -638,18 +604,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
}
}
private static void OnValueBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var gauge = (RadialGauge)d;
gauge.Foreground = (Brush)e.NewValue;
}
private static void OnUnitBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var gauge = (RadialGauge)d;
gauge.Resources["RadialGaugeAccentBrush"] = (Brush)e.NewValue;
}
private static void OnFaceChanged(DependencyObject d)
{
RadialGauge radialGauge = (RadialGauge)d;

Просмотреть файл

@ -39,14 +39,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
public static readonly DependencyProperty ModeProperty =
DependencyProperty.Register(nameof(Mode), typeof(ScrollHeaderMode), typeof(ScrollHeader), new PropertyMetadata(ScrollHeaderMode.None, OnModeChanged));
/// <summary>
/// Identifies the <see cref="TargetListViewBase"/> property.
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
public static readonly DependencyProperty TargetListViewBaseProperty =
DependencyProperty.Register(nameof(TargetListViewBase), typeof(Windows.UI.Xaml.Controls.ListViewBase), typeof(ScrollHeader), new PropertyMetadata(null, OnTargetChanged));
#pragma warning restore CS0618 // Type or member is obsolete
/// <summary>
/// Gets or sets a value indicating whether the current mode.
/// Default is none.
@ -57,16 +49,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
set { SetValue(ModeProperty, value); }
}
/// <summary>
/// Gets or sets the container this header belongs to
/// </summary>
[Obsolete("This property has been deprecated and isn't required.")]
public Windows.UI.Xaml.Controls.ListViewBase TargetListViewBase
{
get { return (Windows.UI.Xaml.Controls.ListViewBase)GetValue(TargetListViewBaseProperty); }
set { SetValue(TargetListViewBaseProperty, value); }
}
/// <summary>
/// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call <see cref="Control.ApplyTemplate"/>.
/// </summary>

Просмотреть файл

@ -1,24 +0,0 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************
using System;
namespace Microsoft.Toolkit.Uwp.UI.Controls
{
/// <summary>
/// Helper class that provides attached properties to enable any TextBox with the Surface Dial. Rotate to change the value by StepValue between MinValue and MaxValue, and tap to go to the Next focus element from a TextBox
/// </summary>
[Obsolete("Use Microsoft.Toolkit.Uwp.UI.Extensions.SurfaceDialTextbox")]
public class SurfaceDialTextboxHelper : Microsoft.Toolkit.Uwp.UI.Extensions.SurfaceDialTextbox
{
}
}

Просмотреть файл

@ -1,25 +0,0 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************
using System;
namespace Microsoft.Toolkit.Uwp.UI.Controls
{
/// <summary>
/// TextBox mask property allows a user to more easily enter fixed width text in TextBox control
/// where you would like them to enter the data in a certain format
/// </summary>
[Obsolete("Use Microsoft.Toolkit.Uwp.UI.Extensions.TextBoxMask")]
public class TextBoxMask : Microsoft.Toolkit.Uwp.UI.Extensions.TextBoxMask
{
}
}

Просмотреть файл

@ -1,24 +0,0 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************
using System;
namespace Microsoft.Toolkit.Uwp.UI.Controls
{
/// <summary>
/// TextBoxRegex allows text validation using a regular expression.
/// </summary>
[Obsolete("Use Microsoft.Toolkit.Uwp.UI.Extensions.TextBoxRegex")]
public class TextBoxRegex : Microsoft.Toolkit.Uwp.UI.Extensions.TextBoxRegex
{
}
}