diff --git a/Microsoft.Toolkit.Services/Services/OneDrive/OneDriveStorageItem.cs b/Microsoft.Toolkit.Services/Services/OneDrive/OneDriveStorageItem.cs index 1c4ce9760c9..765c2f225c4 100644 --- a/Microsoft.Toolkit.Services/Services/OneDrive/OneDriveStorageItem.cs +++ b/Microsoft.Toolkit.Services/Services/OneDrive/OneDriveStorageItem.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Graph; +using Microsoft.Toolkit.Extensions; using Newtonsoft.Json; namespace Microsoft.Toolkit.Services.OneDrive @@ -69,35 +70,7 @@ public string FormattedFileSize { get { - var size = FileSize.HasValue ? FileSize.Value : 0; - if (size < 1024) - { - return size.ToString("F0") + " bytes"; - } - else if ((size >> 10) < 1024) - { - return (size / (float)1024).ToString("F1") + " KB"; - } - else if ((size >> 20) < 1024) - { - return ((size >> 10) / (float)1024).ToString("F1") + " MB"; - } - else if ((size >> 30) < 1024) - { - return ((size >> 20) / (float)1024).ToString("F1") + " GB"; - } - else if ((size >> 40) < 1024) - { - return ((size >> 30) / (float)1024).ToString("F1") + " TB"; - } - else if ((size >> 50) < 1024) - { - return ((size >> 40) / (float)1024).ToString("F1") + " PB"; - } - else - { - return ((size >> 50) / (float)1024).ToString("F0") + " EB"; - } + return FileSize.HasValue ? Converters.ToFileSizeString(FileSize.Value) : Converters.ToFileSizeString(0L); } } diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json index 7b75f2a5142..cc5abb6c4ef 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json @@ -378,6 +378,8 @@ "CodeFile": "AadLoginCode.bind", "XamlCodeFile": "AadLoginXaml.bind", "Icon": "/SamplePages/AadLogin/AadLogin.png", + "BadgeUpdateVersionRequired": "DEPRECATED", + "DeprecatedWarning": "The AadLogin control has been replaced with the LoginButton control and will be removed in a future update.", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/AadLogin.md" }, { @@ -388,6 +390,8 @@ "CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Graph/ProfileCard", "XamlCodeFile": "ProfileCardXaml.bind", "Icon": "/SamplePages/ProfileCard/ProfileCard.png", + "BadgeUpdateVersionRequired": "DEPRECATED", + "DeprecatedWarning": "The ProfileCard control has been replaced with the PersonView control and will be removed in a future update.", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/ProfileCard.md" }, { @@ -398,6 +402,8 @@ "CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PeoplePicker", "XamlCodeFile": "PeoplePickerXaml.bind", "Icon": "/SamplePages/PeoplePicker/PeoplePicker.png", + "BadgeUpdateVersionRequired": "DEPRECATED", + "DeprecatedWarning": "The PeoplePicker control has been replaced with the new PeoplePicker control in Microsoft.Toolkit.Graph.Controls and will be removed in a future update.", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/PeoplePicker.md" }, { @@ -428,6 +434,8 @@ "CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PlannerTaskList", "XamlCodeFile": "PlannerTaskListXaml.bind", "Icon": "/SamplePages/PlannerTaskList/PlannerTaskList.png", + "BadgeUpdateVersionRequired": "DEPRECATED", + "DeprecatedWarning": "The PlannerTaskList control will be replaced with a new Task control and will be removed in a future update.", "DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/PlannerTaskList.md" }, { diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/AadLogin/AadLogin.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/AadLogin/AadLogin.cs index 4fe38ba56e1..25688c2ac68 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/AadLogin/AadLogin.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/AadLogin/AadLogin.cs @@ -15,6 +15,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Graph /// /// The AAD Login Control leverages MSAL libraries to support basic AAD sign-in processes for Microsoft Graph and beyond. /// + [Obsolete("This control will be removed in a future release of the toolkit. Please use the new Graph controls at https://aka.ms/wgt")] [TemplatePart(Name = "RootGrid", Type = typeof(Grid))] [TemplatePart(Name = "ContentPresenter", Type = typeof(ContentPresenter))] public partial class AadLogin : Button diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PeoplePicker/PeoplePicker.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PeoplePicker/PeoplePicker.cs index 2d6bb554d1f..142e59d696d 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PeoplePicker/PeoplePicker.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PeoplePicker/PeoplePicker.cs @@ -19,6 +19,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Graph /// /// The PeoplePicker Control is a simple control that allows for selection of one or more users from an organizational AD. /// + [Obsolete("This control will be removed in a future release of the toolkit. Please use the new Graph controls at https://aka.ms/wgt")] [TemplatePart(Name = SearchBoxPartName, Type = typeof(TextBox))] [TemplatePart(Name = InternalSearchBoxTextBoxPartName, Type = typeof(TextBox))] [TemplatePart(Name = SearchResultListBoxPartName, Type = typeof(ListBox))] diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PlannerTaskList/PlannerTaskList.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PlannerTaskList/PlannerTaskList.cs index b5f4cd3bb5c..5e5a8770b73 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PlannerTaskList/PlannerTaskList.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/PlannerTaskList/PlannerTaskList.cs @@ -19,6 +19,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Graph /// /// The PlannerTaskList Control displays a simple list of Planner tasks. /// + [Obsolete("This control will be removed in a future release of the toolkit. Please use the new Graph controls at https://aka.ms/wgt")] [TemplatePart(Name = ControlTasks, Type = typeof(ListView))] [TemplatePart(Name = ControlInput, Type = typeof(TextBox))] [TemplatePart(Name = ControlAdd, Type = typeof(Button))] diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/ProfileCard/ProfileCard.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/ProfileCard/ProfileCard.cs index 725fcdea44f..7058336bba3 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/ProfileCard/ProfileCard.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/ProfileCard/ProfileCard.cs @@ -15,6 +15,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls.Graph /// /// The Profile Card control is a simple way to display a user in multiple different formats and mixes of name/image/e-mail. /// + [Obsolete("This control will be removed in a future release of the toolkit. Please use the new Graph controls at https://aka.ms/wgt")] public partial class ProfileCard : Control { private static readonly BitmapImage PersonPhoto = new BitmapImage(new Uri("ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Graph/Assets/person.png")); diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/FileSizeConverter.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/FileSizeConverter.cs deleted file mode 100644 index 35f040ccd49..00000000000 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/FileSizeConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using Microsoft.Toolkit.Extensions; -using Windows.UI.Xaml.Data; - -namespace Microsoft.Toolkit.Uwp.UI.Controls.Graph -{ - internal class FileSizeConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, string language) - { - long size = (long)value; - return size.ToFileSizeString(); - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) - { - throw new NotImplementedException(); - } - } -} diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/SharePointFileList.xaml b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/SharePointFileList.xaml index 2d03f48896e..5a829c0ba79 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/SharePointFileList.xaml +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Graph/SharePointFileList/SharePointFileList.xaml @@ -1,10 +1,11 @@  + xmlns:local="using:Microsoft.Toolkit.Uwp.UI.Controls.Graph" + xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"> - +