This commit is contained in:
Brandon Minnick 2022-11-16 13:13:11 -06:00
Родитель ee871985ce
Коммит 64b2211366
9 изменённых файлов: 72 добавлений и 72 удалений

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

@ -10,15 +10,15 @@ public class MauiProgram
var builder = MauiApp.CreateBuilder()
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMarkup();
// Fonts
builder.ConfigureFonts(fonts => fonts.AddFont("FontAwesome.otf", "FontAwesome"));
// App Shell
builder.Services.AddTransient<AppShell>();
// Services
.UseMauiCommunityToolkitMarkup();
// Fonts
builder.ConfigureFonts(fonts => fonts.AddFont("FontAwesome.otf", "FontAwesome"));
// App Shell
builder.Services.AddTransient<AppShell>();
// Services
builder.Services.AddSingleton<App>();
builder.Services.AddSingleton(Browser.Default);
builder.Services.AddSingleton<SettingsService>();
@ -26,9 +26,9 @@ public class MauiProgram
builder.Services.AddSingleton<HackerNewsAPIService>();
builder.Services.AddRefitClient<IHackerNewsApi>()
.ConfigureHttpClient(client => client.BaseAddress = new Uri("https://hacker-news.firebaseio.com/v0"))
.AddTransientHttpErrorPolicy(builder => builder.WaitAndRetryAsync(3, sleepDurationProvider));
// Pages + View Models
.AddTransientHttpErrorPolicy(builder => builder.WaitAndRetryAsync(3, sleepDurationProvider));
// Pages + View Models
builder.Services.AddTransient<NewsPage, NewsViewModel>();
builder.Services.AddTransient<SettingsPage, SettingsViewModel>();
builder.Services.AddTransient<NewsDetailPage, NewsDetailViewModel>();

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

@ -5,7 +5,7 @@ using Microsoft.Maui.Controls;
namespace CommunityToolkit.Maui.Markup.UnitTests;
public static class ApplicationTestHelpers
{
{
/// <summary>
/// Performs a test relating to the <see cref="AppTheme"/> of a running application.
/// </summary>

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

@ -1,11 +1,11 @@
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Extension methods for setting <see cref="AutomationProperties"/> on <see cref="BindableObject"/>s.
/// These methods provide helpful ways of fluently setting properties.
/// </summary>
public static class AutomationPropertiesExtensions
{
{
/// <summary>
/// Sets a value determining if the <paramref name="bindable"/> and its children should be excluded from the accessibility tree.
/// </summary>
@ -23,8 +23,8 @@ public static class AutomationPropertiesExtensions
{
AutomationProperties.SetExcludedWithChildren(bindable, isExcludedWithChildren);
return bindable;
}
}
/// <summary>
/// Sets a value determining if the <paramref name="bindable"/> is visible to screen readers.
/// </summary>

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

@ -1,12 +1,12 @@
using Microsoft.Maui.Controls.Internals;
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Extension Methods for IDynamicResourceHandler
/// </summary>
public static class DynamicResourceHandlerExtensions
{
{
/// <summary>
/// Set Dynamic Resource
/// </summary>
@ -21,8 +21,8 @@ public static class DynamicResourceHandlerExtensions
dynamicResourceHandler.SetDynamicResource(property, key);
return dynamicResourceHandler;
}
}
/// <summary>
/// Set Dynamic Resource
/// </summary>

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

@ -1,10 +1,10 @@
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Extension methods for IImage
/// </summary>
public static class ImageExtensions
{
{
/// <summary>
/// Sets the <see cref="IImageSourcePart.Source" /> Property/>
/// </summary>
@ -16,8 +16,8 @@ public static class ImageExtensions
{
bindable.SetValue(ImageElement.SourceProperty, imageSource);
return bindable;
}
}
/// <summary>
/// Sets the <see cref="Microsoft.Maui.IImage.Aspect" /> Property/>
/// </summary>
@ -29,8 +29,8 @@ public static class ImageExtensions
{
bindable.SetValue(ImageElement.AspectProperty, aspect);
return bindable;
}
}
/// <summary>
/// Sets the <see cref="Microsoft.Maui.IImage.IsOpaque" /> Property/>
/// </summary>

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

@ -1,13 +1,13 @@
using System.Collections;
using System.Windows.Input;
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Fluent extension methods for <see cref="ItemsView"/>
/// </summary>
public static class ItemsViewExtensions
{
{
/// <summary>
/// Assigns the <see cref="ItemsView.EmptyView"/> property
/// </summary>
@ -19,8 +19,8 @@ public static class ItemsViewExtensions
{
itemsView.EmptyView = view;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.EmptyViewTemplate"/> property
/// </summary>
@ -32,8 +32,8 @@ public static class ItemsViewExtensions
{
itemsView.EmptyViewTemplate = view;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.ItemsSource"/> property
/// </summary>
@ -45,8 +45,8 @@ public static class ItemsViewExtensions
{
itemsView.ItemsSource = itemsSource;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.HorizontalScrollBarVisibility"/> property
/// </summary>
@ -58,8 +58,8 @@ public static class ItemsViewExtensions
{
itemsView.HorizontalScrollBarVisibility = visibility;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.VerticalScrollBarVisibility"/> property
/// </summary>
@ -71,8 +71,8 @@ public static class ItemsViewExtensions
{
itemsView.VerticalScrollBarVisibility = visibility;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.VerticalScrollBarVisibility"/> and <see cref="ItemsView.HorizontalScrollBarVisibility"/> properties
/// </summary>
@ -83,8 +83,8 @@ public static class ItemsViewExtensions
public static TItemsView ScrollBarVisibility<TItemsView>(this TItemsView itemsView, ScrollBarVisibility visibility) where TItemsView : ItemsView
{
return itemsView.HorizontalScrollBarVisibility(visibility).VerticalScrollBarVisibility(visibility);
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.RemainingItemsThreshold"/> property
/// </summary>
@ -96,8 +96,8 @@ public static class ItemsViewExtensions
{
itemsView.RemainingItemsThreshold = threshold;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.RemainingItemsThresholdReachedCommand"/> ans <see cref="ItemsView.RemainingItemsThresholdReachedCommandParameter"/>properties
/// </summary>
@ -109,8 +109,8 @@ public static class ItemsViewExtensions
public static TItemsView RemainingItemsThresholdReachedCommand<TItemsView>(this TItemsView itemsView, ICommand command, object? parameter) where TItemsView : ItemsView
{
return itemsView.RemainingItemsThresholdReachedCommand(command).RemainingItemsThresholdReachedCommandParameter(parameter);
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.RemainingItemsThresholdReachedCommand"/> property
/// </summary>
@ -122,8 +122,8 @@ public static class ItemsViewExtensions
{
itemsView.RemainingItemsThresholdReachedCommand = command;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.RemainingItemsThresholdReachedCommandParameter"/> property
/// </summary>
@ -135,8 +135,8 @@ public static class ItemsViewExtensions
{
itemsView.RemainingItemsThresholdReachedCommandParameter = parameter;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.ItemTemplate"/> property
/// </summary>
@ -148,8 +148,8 @@ public static class ItemsViewExtensions
{
itemsView.ItemTemplate = template;
return itemsView;
}
}
/// <summary>
/// Assigns the <see cref="ItemsView.ItemsUpdatingScrollMode"/> property
/// </summary>

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

@ -1,10 +1,10 @@
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Extension Methods for Label
/// </summary>
public static class LabelExtensions
{
{
/// <summary>
/// Sets Formatted Text
/// </summary>

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

@ -1,10 +1,10 @@
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Extension Methods for <see cref="IPlaceholder"/>
/// </summary>
public static class PlaceholderExtensions
{
{
/// <summary>
/// Sets the <see cref="IPlaceholder.PlaceholderColor"/> Property
/// </summary>
@ -16,8 +16,8 @@ public static class PlaceholderExtensions
{
bindable.SetValue(PlaceholderElement.PlaceholderColorProperty, textColor);
return bindable;
}
}
/// <summary>
/// Sets the <see cref="IPlaceholder.Placeholder" /> Property/>
/// </summary>
@ -29,8 +29,8 @@ public static class PlaceholderExtensions
{
bindable.SetValue(PlaceholderElement.PlaceholderProperty, text);
return bindable;
}
}
/// <summary>
/// Sets the <see cref="IPlaceholder.Placeholder" /> and <see cref="IPlaceholder.PlaceholderColor" /> Properties/>
/// </summary>

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

@ -1,11 +1,11 @@
namespace CommunityToolkit.Maui.Markup;
namespace CommunityToolkit.Maui.Markup;
/// <summary>
/// Extension methods for setting <see cref="SemanticProperties"/> on <see cref="BindableObject"/>s.
/// These methods provide helpful ways of fluently setting properties.
/// </summary>
public static class SemanticPropertiesExtensions
{
{
/// <summary>
/// Sets a short, descriptive string that the platforms screen reader uses to announce the <paramref name="bindable"/>.
/// </summary>
@ -23,8 +23,8 @@ public static class SemanticPropertiesExtensions
{
SemanticProperties.SetDescription(bindable, description);
return bindable;
}
}
/// <summary>
/// Sets a heading level to enable the <paramref name="bindable"/> to be marked as a heading to organize the UI and make it easier to navigate.
/// </summary>
@ -42,8 +42,8 @@ public static class SemanticPropertiesExtensions
{
SemanticProperties.SetHeadingLevel(bindable, headingLevel);
return bindable;
}
}
/// <summary>
/// Sets an additional context to that set in <see cref="SemanticDescription{TBindable}(TBindable, string)"/>, such as the purpose of the <paramref name="bindable"/>.
/// </summary>