template10

Dependency Injection using Template 10

烂漫一生 提交于 2019-12-19 11:37:14
问题 I am trying to migrate some code from an old Windows 8.1 app that I had developed using Prism/Unity to a new UWP app using Template 10 and Unity. I have seen in the documentation for Template 10 here that you can override the ResolveForPage method. In my old Windows 8.1 app, there is a Resolve method in Prism that I would override like this: protected override object Resolve(Type type) { return Container.Resolve(type); } The signature for the Template 10 method is public override INavigable

template 10: declaring a new button in hamburger navigation and navigating to its page

你。 提交于 2019-12-13 19:31:39
问题 I am kind of beginner in UWP Platform and I am building an app using template 10. I have used GridView for a particular page, but the problem is that the GridView shows its borders when you hover over it or select its item. Like this: I want the border not to show up whenever the user hovers over it or selects a GridView item. My XAML Code is: <Page x:Class="Sample.Views.Category" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx

Template 10 hamburger menu detail page disappears after resume

荒凉一梦 提交于 2019-12-13 06:59:51
问题 Start app [Press home button] press "all apps" on home screen and the icon for my app now i only see the hamburger icon. this is my suspend and resume functions. 回答1: Resolved by the Template10 team. dg2k. All is fine. Just change ExistingContent.Exclude to ExistingContent.Include for the following line in public override UIElement CreateRootElement(IActivatedEventArgs e) (App.xaml.cs). public override UIElement CreateRootElement(IActivatedEventArgs e) { ... var navService =

How can I transfer parameter from one page to another?

蹲街弑〆低调 提交于 2019-12-13 02:26:00
问题 I have an UWP using Template10. I want to have a grid with items and on the OnClick event of an item I want to open another page. The usual var item = (Invitation)e.ClickedItem; this.Frame.Navigate(typeof(MainPage), item.Id); does not seems to work. How can I do this? 回答1: I made a simple sample to demonstrate you how you can pass parameteres from one page to other. I will not use MVVM architecture because it will be a simple demonstration. Here is my MainPage: <Page x:Class="App1.MainPage"

Template 10 dependency injection using MEF

落花浮王杯 提交于 2019-12-12 03:49:46
问题 I'm familiar with using MEF in .NET Framework 4.6.* but not in .NET Core. I'm messing about with the Hamburger template from Template 10 to see if it is suitable for my needs but I haven't been able to figure out how to compose my view models using MEF. My question is how can I navigate to a view using the navigation service in such a way that its view model will be injected by MEF? 回答1: I have one way of getting this working but it seems a bit code smelly so better answers are welcomed. I

Exception when supsending/resuming on W10M - Value does not fall within the expected range

六眼飞鱼酱① 提交于 2019-12-12 02:44:54
问题 I am using Template 10 NuGet Version 1.1.4 and am seeing the following exception when I perform the below actions on my Windows 10 Mobile device: Run the App Press the Windows Home button (takes me back to the Start screen) Run the App again What happens is that the app fails to start, with an exception of: Value does not fall within the expected range. Call Stack: at Windows.UI.Xaml.Controls.ContentControl.put_Content(Object value) at Template10.Common.BootStrapper.NavigationServiceFactory

What should the value of Windows.Current.Content be after opening a secondary window?

限于喜欢 提交于 2019-12-11 02:35:45
问题 This is the suggested code in the App class from the Template10 article on implementing a shell: public override Task OnInitializeAsync(IActivatedEventArgs args) { var nav = NavigationServiceFactory(BackButton.Attach, ExistingContent.Include); Window.Current.Content = new Views.Shell(nav); return Task.FromResult<object>(null); } The new shell object is assigned to Windows.Current.Content. This is the suggested code for opening a secondary window (not with a shell), from the Template10

UWP navigation (Template10), Pivot control, multiple frames

拟墨画扇 提交于 2019-12-11 01:52:22
问题 I'm trying to implement the following style of navigation in my UWP app (using Template10) but am struggling how to use the multiple frames as independent history stacks. Within each frame of the pivot, I'd want to have an independent frame that has it's own history and back stack. Navigating between the frames would only be possible via the pivot. I was thinking of using code similar to the below: <Pivot> <PivotItem Header="PageA"> <Frame x:Name="PageAFrame" /> </PivotItem> <PivotItem Header

Using multiple views with Template10 without always showing the Main Page?

淺唱寂寞╮ 提交于 2019-12-10 11:16:47
问题 I am new to T10 and trying to learn it. This is a follow-up to Template 10 Multiple Windows In 'regular' (meaning non-Template10) UWP app I've learned to do something like this (as a short example) in order to support multiple views: public App() { InitializeComponent(); Suspending += OnSuspending; } readonly List<CoreDispatcher> _dispatchers = new List<CoreDispatcher>(); protected override async void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame;

Sharing target Universal Apps Template10 approach in Windows 10

巧了我就是萌 提交于 2019-12-10 10:19:43
问题 My app is a target app for sharing and am facing issues when the app is running and the user wants to share content. I can't use a frame from the running application because then i get a "marshalling thread" exception. The application called an interface that was marshalled for a different thread.\r\n\r\nFailed to initialize the application's root visual My OnStartAsync method in App.xaml.cs looks like this. public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args