diff --git a/.editorconfig b/.editorconfig index 41a57d87..efd00a80 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,8 @@ # To learn more about .editorconfig see https://aka.ms/editorconfigdocs +root = true ############################### # Core EditorConfig Options # ############################### -root = true # All files [*] end_of_line = crlf @@ -14,7 +14,7 @@ trim_trailing_whitespace = true indent_size = 4 charset = utf-8-bom # Project files -[*.{csproj,fsproj,vbproj,shproj,projitems,plist,nuspec}] +[*.{csproj,fsproj,vbproj,shproj,projitems,props,nuspec,config,xaml,xml,plist}] indent_size = 2 charset = utf-8-bom ############################### @@ -37,8 +37,11 @@ dotnet_style_parentheses_in_relational_binary_operators = always_for_cl dotnet_style_parentheses_in_other_binary_operators = always_for_clarity : suggestion dotnet_style_parentheses_in_other_operators = never_if_unnecessary : suggestion # Modifier preferences -dotnet_style_require_accessibility_modifiers = always : warning dotnet_style_readonly_field = true : warning +dotnet_style_require_accessibility_modifiers = always : warning +roslynator_accessibility_modifiers = explicit +roslynator_enum_has_flag_style = method +roslynator_object_creation_type_style = implicit # Expression-level preferences dotnet_style_object_initializer = true : warning dotnet_style_collection_initializer = true : warning @@ -815,7 +818,7 @@ dotnet_diagnostic.CA5383.severity = warning # CA5384: Do Not Use Digital Signature Algorithm (DSA) dotnet_diagnostic.CA5384.severity = warning -# CA5385: Use Rivest–Shamir–Adleman (RSA) Algorithm With Sufficient Key Size +# CA5385: Use Rivest-Shamir-Adleman (RSA) Algorithm With Sufficient Key Size dotnet_diagnostic.CA5385.severity = warning # CA5386: Avoid hardcoding SecurityProtocolType value @@ -874,3 +877,24 @@ dotnet_diagnostic.CA5403.severity = warning # CA9999: Analyzer version mismatch dotnet_diagnostic.CA9999.severity = warning + +############################### +# Code Analysis Exceptions # +############################### +[**/{Main.cs,Program.cs,*Activity.cs,*Page.cs,*.xaml.cs,Controls/**.cs}] +# CA1010: Collections should implement generic interface +dotnet_diagnostic.CA1010.severity = none +# CA1012: Abstract type 'ShellBase' should not have public constructors +dotnet_diagnostic.CA1012.severity = none +# CA1501: Avoid excessive inheritance +dotnet_diagnostic.CA1501.severity = none +# IDE0001: Simplify Names +dotnet_diagnostic.IDE0001.severity = suggestion +# IDE0021: Use expression body for constructors +dotnet_diagnostic.IDE0021.severity = suggestion + +[{App.xaml.cs,Shell.xaml.cs,Program.cs}] +# CA1724: The type name App conflicts in whole or in part with the namespace name. Change either name to eliminate the conflict. +dotnet_diagnostic.CA1724.severity = none +# CA1801: Parameter args of method Main is never used. Remove the parameter or use it in the method body. +dotnet_diagnostic.CA1801.severity = none diff --git a/src/Elmish.Uno.Uwp/Elmish.Uno.Uwp.csproj b/src/Elmish.Uno.Uwp/Elmish.Uno.Uwp.csproj index 018134de..cd4359f6 100644 --- a/src/Elmish.Uno.Uwp/Elmish.Uno.Uwp.csproj +++ b/src/Elmish.Uno.Uwp/Elmish.Uno.Uwp.csproj @@ -130,7 +130,7 @@ PackageReference - $(OutputPath)\Elmish.Uno.Mobile.XML + $(OutputPath)Elmish.Uno.Mobile.xml diff --git a/src/Elmish.Uno.Uwp/NavigationService.cs b/src/Elmish.Uno.Uwp/NavigationService.cs index f75787eb..9ee56453 100644 --- a/src/Elmish.Uno.Uwp/NavigationService.cs +++ b/src/Elmish.Uno.Uwp/NavigationService.cs @@ -2,21 +2,38 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; + using Windows.UI.Xaml.Controls; namespace Elmish.Uno.Navigation { + /// + /// Class that allows to navigate to pages within an attached + /// using a dictionary map of page names and their types. + /// public class NavigationService : INavigationService { private readonly Frame frame; private readonly IReadOnlyDictionary pageMap; + /// + /// Creates a NavigationService instance attaching a + /// and specifying a map of pages names and their types. + /// + /// Frame to use for navigation. + /// Map of page names to page types. public NavigationService(Frame frame, IReadOnlyDictionary pageMap) { this.frame = frame; this.pageMap = pageMap; } + /// + /// Creates a NavigationService instance attaching a + /// and specifying a list of pages names and their types pairs. + /// + /// Frame to use for navigation. + /// Map of page names to page types. public NavigationService(Frame frame, IEnumerable> pageMap) { this.frame = frame; @@ -26,19 +43,63 @@ public NavigationService(Frame frame, IEnumerable> pa .ToImmutable(); } + /// + /// Gets the number of pages in the navigation history that can be cached for the . + /// public int CacheSize => frame.CacheSize; + /// + /// Gets the number of entries in the navigation back stack. + /// public int BackStackDepth => frame.BackStackDepth; + /// + /// Gets a value that indicates whether there is at least one entry in + /// back navigation history. + /// public bool CanGoBack => frame.CanGoBack; + /// + /// Gets a value that indicates whether there is at least one entry in + /// forward navigation history. + /// public bool CanGoForward => frame.CanGoForward; + /// + /// Serializes the navigation history into a string. + /// + /// The string-form serialized navigation history. public string GetNavigationState() => frame.GetNavigationState(); + /// + /// Reads and restores the navigation history of a from + /// a provided serialization string. + /// + /// + /// The serialization string that supplies the restore point for navigation history. + /// public void SetNavigationState(string navigationState) => frame.SetNavigationState(navigationState); + /// + /// Navigates to the most recent item in back navigation history, + /// if a Frame manages its own navigation history. + /// public void GoBack() => frame.GoBack(); + /// + /// Navigates to the most recent item in forward navigation history, + /// if a Frame manages its own navigation history. + /// public void GoForward() => frame.GoForward(); + /// + /// Navigates an attached to a page specified my its name. + /// + /// Page name + /// True if navigation succeeded. public bool Navigate(string name) => frame.Navigate(pageMap[name], null); + /// + /// Navigates an attached to a page specified my its name. + /// + /// Page name + /// Parameter to be passed to a page + /// True if navigation succeeded. public bool Navigate(string name, IReadOnlyDictionary navigationParams) => frame.Navigate(pageMap[name], navigationParams); } } diff --git a/src/Elmish.Uno.Uwp/ViewModel.cs b/src/Elmish.Uno.Uwp/ViewModel.cs index b2b6f67d..492db231 100644 --- a/src/Elmish.Uno.Uwp/ViewModel.cs +++ b/src/Elmish.Uno.Uwp/ViewModel.cs @@ -16,23 +16,70 @@ namespace Elmish.Windows { + /// + /// Implementation of dynamic property required by WinRT to do bindings. + /// + /// Target object type from which to get and to which to set a property value. + /// Value type. public class DynamicCustomProperty : ICustomProperty { + /// + /// Property getter delegate. + /// public Func Getter { get; } + /// + /// Property setter delegate + /// public Action Setter { get; } + /// + /// Indexer getter delegate + /// public Func IndexGetter { get; } + /// + /// Indexer setter delegate + /// public Action IndexSetter { get; } - public object GetValue(object target) => Getter.Invoke((TTarget) target); + /// Gets the value of the custom property from a particular instance. + /// The owning instance. + /// The retrieved value. + public object GetValue(object target) => Getter.Invoke((TTarget)target); + /// Sets the custom property value on a specified instance. + /// The owner instance. + /// The value to set. public void SetValue(object target, object value) => Setter.Invoke((TTarget)target, (TValue)value); + /// Gets the value at an index location, for cases where the custom property has indexer support. + /// The owning instance. + /// The index to get. + /// The retrieved value at the index. public object GetIndexedValue(object target, object index) => IndexGetter.Invoke((TTarget)target, index); + /// Sets the value at an index location, for cases where the custom property has indexer support. + /// The owner instance. + /// The value to set. + /// The index location to set to. public void SetIndexedValue(object target, object value, object index) => IndexSetter.Invoke((TTarget)target, index, (TValue)value); + /// Gets a value that determines whether the custom property supports read access. + /// **true** if the property value can be read as a data source. **false** if the property cannot be a data source value. public bool CanRead => Getter != null || IndexGetter != null; + /// Gets a value that determines whether the custom property supports write access. + /// **true** if the value can be written to through a data source relationship in a two-way binding. **false** if the property cannot be written to. public bool CanWrite => Setter != null || IndexSetter != null; + /// Gets the path-relevant name of the property. + /// The name of the property as it would be specified in a binding expression. public string Name { get; } + /// Gets the underlying type of the custom property. + /// The underlying type, with relevant information as the values of the TypeName structure. TypeName provides the infrastructure such that property backing does not have to resemble common language runtime (CLR) and **System.Type** definitions. public Type Type => typeof(TValue); + /// + /// Creates an instance of DynamicCustomProperty. + /// + /// Property name. + /// Property getter delegate. + /// Property setter delegate. + /// Indexer getter delegate. + /// Indexer setter delegate. public DynamicCustomProperty(string name, Func getter, Action setter = null, Func indexGetter = null, Action indexSetter = null) { Name = name; @@ -112,41 +159,83 @@ private ICustomProperty GetProperty(string name) namespace Elmish.Uno { + /// + /// View model methods to correspond to F# module + /// [RequireQualifiedAccess, CompilationMapping(SourceConstructFlags.Module)] public static class ViewModel { + /// + /// Creates an instance of Elmish view model without dispatcher subscription. + /// + /// Model type. + /// Elmish message type. + /// Design time model. + /// Elmish program to run. + /// An instance of internal Elmish view model class. public static object DesignInstance(TModel model, FSharpList> bindings) { var emptyDispatch = FuncConvert.FromAction((TMsg msg) => { }); return new Elmish.Windows.ViewModel(model, emptyDispatch, bindings, ElmConfig.Default, "main"); } - public static object DesignInstance(TModel model, Program>> program) + /// + /// Creates an instance of Elmish view model without dispatcher subscription. + /// and with an initial program argument. + /// + /// Initial program argument type. + /// Model type. + /// Elmish message type. + /// Design time model. + /// Elmish program to run. + /// An instance of internal Elmish view model class. + public static object DesignInstance(TModel model, Program>> bindings) { var emptyDispatch = FuncConvert.FromAction((TMsg msg) => { }); - var mapping = FSharpFunc>.InvokeFast(ProgramModule.view(program), model, emptyDispatch); + var mapping = FSharpFunc>.InvokeFast(ProgramModule.view(bindings), model, emptyDispatch); return DesignInstance(model, mapping); } - public static void StartLoop(ElmConfig config, FrameworkElement element, Action>>> programRun, Program>> program) + /// + /// Creates an instance of Elmish view model with dispatcher subscription. + /// + /// Model type. + /// Elmish message type. + /// Elmish config. + /// UI control to set DataContext property on. + /// Elmish bindings definitions list. + /// Elmish program to run. + public static void StartLoop(ElmConfig config, FrameworkElement element, Action>>> bindings, Program>> program) { FSharpRef>> lastModel = new FSharpRef>>(null); FSharpFunc, FSharpFunc> syncDispatch = FuncConvert.FromAction(MakeSyncDispatch(element)); var setState = FuncConvert.FromAction(MakeSetState(config, element, program, lastModel)); - programRun.Invoke( + bindings.Invoke( ProgramModule.withSyncDispatch(syncDispatch, ProgramModule.withSetState(setState, program))); } - public static void StartLoop(ElmConfig config, FrameworkElement element, Action>>> programRun, Program>> program, T arg) + /// + /// Creates an instance of Elmish view model with dispatcher subscription + /// and with an initial program argument. + /// + /// Initial program argument type. + /// Model type. + /// Elmish message type. + /// Elmish config. + /// UI control to set DataContext property on. + /// Elmish bindings definitions list. + /// Elmish program to run. + /// Initial program argument. + public static void StartLoop(ElmConfig config, FrameworkElement element, Action>>> bindings, Program>> program, T arg) { FSharpRef>> lastModel = new FSharpRef>>(null); FSharpFunc, FSharpFunc> syncDispatch = FuncConvert.FromAction(MakeSyncDispatch(element)); var setState = FuncConvert.FromAction(MakeSetState(config, element, program, lastModel)); - programRun.Invoke(arg, + bindings.Invoke(arg, ProgramModule.withSyncDispatch(syncDispatch, ProgramModule.withSetState(setState, program))); } diff --git a/src/Elmish.Uno.sln b/src/Elmish.Uno.sln index 4c342184..f69331a7 100644 --- a/src/Elmish.Uno.sln +++ b/src/Elmish.Uno.sln @@ -32,6 +32,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{49DD7592-B03D-4EEE-B1BF-522488992C80}" ProjectSection(SolutionItems) = preProject ..\Elmish.Uno.nuspec = ..\Elmish.Uno.nuspec + Templates\Templates.nuspec = Templates\Templates.nuspec EndProjectSection EndProject Global diff --git a/src/Samples/Samples.Droid/Samples.Droid.csproj b/src/Samples/Samples.Droid/Samples.Droid.csproj index 974de8db..6c947920 100644 --- a/src/Samples/Samples.Droid/Samples.Droid.csproj +++ b/src/Samples/Samples.Droid/Samples.Droid.csproj @@ -76,9 +76,11 @@ - + - + + + diff --git a/src/Samples/Samples.Shared/App.xaml.cs b/src/Samples/Samples.Shared/App.xaml.cs index 3ff6c03c..681dfc07 100644 --- a/src/Samples/Samples.Shared/App.xaml.cs +++ b/src/Samples/Samples.Shared/App.xaml.cs @@ -1,21 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; +using System.Diagnostics.Contracts; + using Microsoft.Extensions.Logging; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; -using Windows.Foundation; -using Windows.Foundation.Collections; using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; namespace Elmish.Uno.Samples { @@ -50,9 +39,10 @@ public App() /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs e) + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs args) { + Contract.Assume(args != null); #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { @@ -76,7 +66,8 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) // Create a Frame to act as the navigation context and navigate to the first page shell = new Shell(); - if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) +#pragma warning disable Uno0001 // Uno type or member is not implemented + if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } @@ -86,7 +77,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) } #if !(NET5_0 && WINDOWS) - if (e.PrelaunchActivated == false) + if (args.PrelaunchActivated == false) #endif { if (shell.RootFrame.Content == null) @@ -94,11 +85,12 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter - shell.Navigate(typeof(MainPage), e.Arguments); + shell.Navigate(typeof(MainPage), args.Arguments); } // Ensure the current window is active window.Activate(); } +#pragma warning restore Uno0001 // Uno type or member is not implemented } @@ -111,9 +103,11 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) /// Details about the suspend request. private void OnSuspending(object sender, SuspendingEventArgs e) { +#pragma warning disable Uno0001 // Uno type or member is not implemented var deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); +#pragma warning restore Uno0001 // Uno type or member is not implemented } diff --git a/src/Samples/Samples.Shared/DesignData.cs b/src/Samples/Samples.Shared/DesignData.cs index 9af0d66c..830780bf 100644 --- a/src/Samples/Samples.Shared/DesignData.cs +++ b/src/Samples/Samples.Shared/DesignData.cs @@ -1,25 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using SingleCounterProgram = Elmish.Uno.Samples.SingleCounter.Program; +#pragma warning disable CA1812 // Avoid uninstantiated internal classes +#pragma warning disable CA1822 // Member does not access instance data and can be marked as static +using EventBindingsAndBehaviorsProgram = Elmish.Uno.Samples.EventBindingsAndBehaviors.Program; +using FileDialogsCmdMsgProgram = Elmish.Uno.Samples.FileDialogsCmdMsg.Program; +using FileDialogsProgram = Elmish.Uno.Samples.FileDialogs.Program; +using NewWindow1Program = Elmish.Uno.Samples.NewWindow.Program.Win1; +using NewWindow2Program = Elmish.Uno.Samples.NewWindow.Program.Win2; +using NewWindowProgram = Elmish.Uno.Samples.NewWindow.Program; using OneWaySeqProgram = Elmish.Uno.Samples.OneWaySeq.Program; -using SubModelProgram = Elmish.Uno.Samples.SubModel.Program; +using SingleCounterProgram = Elmish.Uno.Samples.SingleCounter.Program; using SubModelClockProgram = Elmish.Uno.Samples.SubModel.Program.Clock; using SubModelCounterWithClockProgram = Elmish.Uno.Samples.SubModel.Program.CounterWithClock; -using SubModelOptProgram = Elmish.Uno.Samples.SubModelOpt.Program; using SubModelOptForm1Program = Elmish.Uno.Samples.SubModelOpt.Program.Form1; using SubModelOptForm2Program = Elmish.Uno.Samples.SubModelOpt.Program.Form2; +using SubModelOptProgram = Elmish.Uno.Samples.SubModelOpt.Program; +using SubModelProgram = Elmish.Uno.Samples.SubModel.Program; using SubModelSelectedItemProgram = Elmish.Uno.Samples.SubModelSelectedItem.Program; using SubModelSeqProgram = Elmish.Uno.Samples.SubModelSeq.Program; using UiBoundCmdParamProgram = Elmish.Uno.Samples.UiBoundCmdParam.Program; using ValidationProgram = Elmish.Uno.Samples.Validation.Program; -using FileDialogsProgram = Elmish.Uno.Samples.FileDialogs.Program; -using FileDialogsCmdMsgProgram = Elmish.Uno.Samples.FileDialogsCmdMsg.Program; -using EventBindingsAndBehaviorsProgram = Elmish.Uno.Samples.EventBindingsAndBehaviors.Program; -using NewWindowProgram = Elmish.Uno.Samples.NewWindow.Program; -using NewWindow1Program = Elmish.Uno.Samples.NewWindow.Program.Win1; -using NewWindow2Program = Elmish.Uno.Samples.NewWindow.Program.Win2; namespace Elmish.Uno.Samples { diff --git a/src/Samples/Samples.Shared/FocusWhenVisibleBehavior.cs b/src/Samples/Samples.Shared/FocusWhenVisibleBehavior.cs index b40fafdf..37d0f852 100644 --- a/src/Samples/Samples.Shared/FocusWhenVisibleBehavior.cs +++ b/src/Samples/Samples.Shared/FocusWhenVisibleBehavior.cs @@ -1,4 +1,7 @@ -using Microsoft.Xaml.Interactivity; +#pragma warning disable CA1001 // Types that own disposable fields should be disposable + +using Microsoft.Xaml.Interactivity; + using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; diff --git a/src/Samples/Samples.Shared/Shell.xaml.cs b/src/Samples/Samples.Shared/Shell.xaml.cs index d2ce1c2f..9ebeffb5 100644 --- a/src/Samples/Samples.Shared/Shell.xaml.cs +++ b/src/Samples/Samples.Shared/Shell.xaml.cs @@ -1,19 +1,10 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; using Windows.System; using Windows.UI.Core; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace Elmish.Uno.Samples @@ -28,6 +19,7 @@ public Shell() SystemNavigationManager.GetForCurrentView().BackRequested += OnSystemNavigationManagerBackRequested; +#pragma warning disable Uno0001 // Uno type or member is not implemented KeyboardAccelerator GoBack = new KeyboardAccelerator() { Key = VirtualKey.GoBack @@ -55,6 +47,7 @@ public Shell() AltRight.Invoked += ForwardInvoked; this.KeyboardAccelerators.Add(GoForward); this.KeyboardAccelerators.Add(AltRight); +#pragma warning restore Uno0001 // Uno type or member is not implemented } /// @@ -62,10 +55,10 @@ public Shell() /// /// The Frame which failed navigation /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); - } + private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) +#pragma warning disable CA2201 // Do not raise reserved exception types + => throw new Exception($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); +#pragma warning restore CA2201 // Do not raise reserved exception types private bool OnBackRequested() { @@ -96,6 +89,7 @@ private void OnSystemNavigationManagerBackRequested(object sender, BackRequested private void OnBackButtonClick(object sender, RoutedEventArgs e) => OnBackRequested(); +#pragma warning disable Uno0001 // Uno type or member is not implemented private void BackInvoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs e) { OnBackRequested(); @@ -107,6 +101,7 @@ private void ForwardInvoked(KeyboardAccelerator sender, KeyboardAcceleratorInvok OnForwardRequested(); e.Handled = true; } +#pragma warning restore Uno0001 // Uno type or member is not implemented public bool Navigate(Type sourcePageType) => this.RootFrame.Navigate(sourcePageType, null); diff --git a/src/Samples/Samples.Shared/SingleCounterPage.xaml.cs b/src/Samples/Samples.Shared/SingleCounterPage.xaml.cs index 7e645d6a..8d369ba8 100644 --- a/src/Samples/Samples.Shared/SingleCounterPage.xaml.cs +++ b/src/Samples/Samples.Shared/SingleCounterPage.xaml.cs @@ -1,8 +1,11 @@ using System; using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Globalization; + using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; -using Elmish.Uno; + using ElmishProgram = Elmish.Uno.Samples.SingleCounter.Program; namespace Elmish.Uno.Samples.SingleCounter @@ -16,8 +19,10 @@ public SingleCounterPage() protected override void OnNavigatedTo(NavigationEventArgs e) { + Contract.Assume(e != null); + var parameters = e.Parameter as IReadOnlyDictionary; - var count = Convert.ToInt32(parameters?["count"]); + var count = Convert.ToInt32(parameters?["count"], CultureInfo.InvariantCulture); ViewModel.StartLoop(ElmishProgram.Config, this, Elmish.ProgramModule.runWith, ElmishProgram.Program, count); } } diff --git a/src/Samples/Samples.Shared/SubModelSelectedItemPage.xaml.cs b/src/Samples/Samples.Shared/SubModelSelectedItemPage.xaml.cs index 03e9baee..69287bcc 100644 --- a/src/Samples/Samples.Shared/SubModelSelectedItemPage.xaml.cs +++ b/src/Samples/Samples.Shared/SubModelSelectedItemPage.xaml.cs @@ -1,5 +1,5 @@ using Windows.UI.Xaml.Controls; -using Elmish.Uno; + using ElmishProgram = Elmish.Uno.Samples.SubModelSelectedItem.Program; namespace Elmish.Uno.Samples.SubModelSelectedItem diff --git a/src/Samples/Samples.Shared/Themes/Generic.xaml b/src/Samples/Samples.Shared/Themes/Generic.xaml index 73ac1579..34030ad2 100644 --- a/src/Samples/Samples.Shared/Themes/Generic.xaml +++ b/src/Samples/Samples.Shared/Themes/Generic.xaml @@ -1,8 +1,9 @@  + xmlns:ctrl="using:SolutionTemplate.Controls" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation">