windows-xaml / template10 Goto Github PK
View Code? Open in Web Editor NEWMaking Windows 10 apps great again
License: Apache License 2.0
Making Windows 10 apps great again
License: Apache License 2.0
I'm not sure if I'm doing something wrong or not, but my view is not updating when the view model (based on ViewModelBase) properties they're bound to are updated. It worked fine on previous versions when BindableBase was directly in the minimal project, but not since it was moved to the library project. If I step through the code in the debugger, the PropertyChanged event is always null and prevents it from being invoked.
Any ideas?
The Project file "..\Template10\Template10.csproj" is missing.
I think that the default navigation implementation could be improved in the following ways. First, the titlebar back button functionality should be enabled on supported platforms with a simple Boolean property in the BootStrapper/NavigationService class (eg: "EnableTitleBarBackButtonOnDesktop"). This property would enable the title bar back button globally on Desktop devices only, by manipulating the nitty-gritty parts of the code. Much quicker to code for the developer, and allows them to easily pick and choose the implementation they want.
As a suggestion, the ViewModelBase could inherit from abstract class BindableBase while also implementing INavigable.
from this:
public abstract class ViewModelBase : INavigable
to this:
public abstract class ViewModelBase : BindableBase, INavigable
And its INPC region could then be deleted.
If, according to Models.readme.htm, model classes are supposed to only contain data, where does business logic belong to in this app template? I am aware that, in many cases, the business logic would probably live on a remote server (and the app business logic would limit to simple CRUD operations that could be handled by repositories), but I doubt it would be so in case of all the 90% of developers this template is intended for.
A clean download will not build due to numerous missing files!
This was raised as a previous issue, but closed. It is still very much an issue.
Can the PrimaryButtons on the HamburgerMenu be filled via data binding?
From Shell,xaml
Controls:HamburgerMenu.PrimaryButtons
<Controls:NavigationButtonInfo PageType="views:MainPage" ClearHistory="True">
/Controls:NavigationButtonInfo
/Controls:HamburgerMenu.PrimaryButtons
Hi,
Controls/BackAppBarButton and Themes\Generic.xaml are missing from Project
I see all the Services implementations in "Template10 (Services)" have not Interfaces implementation, unlike the great demo MVA (Oct 2014) Developing Universal Windows Apps with C# and XAML in which every Service has Service, Helper and Interface and from which they seem to be all stealed but the Interfaces
Is there a specific reason or are you planning to implement Interfaces in order to use Dependency Injection?
I can implement though with a pull request if you agree
cs file is missing
The NavigationService is casting the parameter argument of the Navigate method to a string before I receive it in the OnNavigatedTo method of my receiving page's view model . Is this by design? I suspect it's a bug or else the parameter argument should just be a string in the first place.
For example, if I call the Navigate method like so:
NavigationService.Navigate(typeof(Views.MyPage), myCustomObject);
When I receive myCustomObject in the view model it's a string:
public override void OnNavigatedTo(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
// the parameter with myCustomObject is now a string
}
Not really an issue, just a question. What would be the appropriate/best way to share the same view model (a single instance) across multiple views using Template10?
When building using the BootStrapper my XAML designer crashes.
-->
An Unhandled Exception has occured
Click here to reload the designer
Details:
System.NullReferenceException
Object reference not set to an instance of an object.
at Microsoft.MetadataReader.MetadataOnlyModule.GetNestedClassProps(Token tokenTypeDef)
at Microsoft.MetadataReader.MetadataOnlyModule.GetEnclosingType(Token tokenTypeDef)
at Microsoft.MetadataReader.MetadataOnlyTypeDef.get_DeclaringType()
at Microsoft.MetadataReader.MetadataOnlyTypeDef.get_FullName()
at Microsoft.VisualStudio.DesignTools.Platform.Metadata.ProjectContextType.get_FullName()
at Microsoft.VisualStudio.DesignTools.XamlDesigner.DocumentModel.XamlProjectContext.RefreshUnbuiltTypeDescriptions()
at Microsoft.VisualStudio.DesignTools.XamlDesigner.DocumentModel.XamlProjectContext.RebuildNamespaceMaps()
at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.XamlProjectMetadata.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
at Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectAssemblyCollection.FireChangedEvent(NotifyCollectionChangedEventArgs eventArguments)
at Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectAssemblyCollection.AssemblyCollection_EnumerationChanged(Object sender, EnumerationChangedEventArgs`1 e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Microsoft.VisualStudio.DesignTools.Utility.Collections.NotifyingCollectionBase`1.EventInvoker(EnumerationChangedEventArgs`1 eventArguments)
at Microsoft.VisualStudio.DesignTools.Utility.Events.SuspendingEventManager`1.ForwardEvents()
at Microsoft.VisualStudio.DesignTools.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
at Microsoft.VisualStudio.DesignTools.Utility.Events.Suspender.SuspendDisposer.Dispose()
at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyCollection.AssemblyService_AssembliesUpdated(Object sender, EventArgs`1 e)
at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyService.OnAssembliesUpdated(IEnumerable`1 assemblyInformation)
at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyService.RefreshDesignerCaches()
at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.SetIterationContext(String[] paths)
at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.SynchronizeDesignerContext()
at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.ProcessShadowCopyResults(IEnumerable`1 results)
at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyService.FlushShadowCopyUpdateQueue()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication()
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.AppContainerDesignerProcessRun(String[] activationContextArgs)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.<>c__DisplayClass3_0.<applicationView_Activated>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
1: Launch minimal and navigate to the settings page.
2: Close minimal.
3: Re-launch minimal - you are brought back to the Settings page automatically, however the Settings Nav button in the HamburgerMenu isn't highlighted.
(was also able to reproduce such that when relaunched, it would return me to the Main page, but the Home nav button wasn't selected. A Subsequent re-launch did then show the proper state on the Home nav button..)
The same thing happens when using Template10Library's latest code in my own app as well. You can see the app quickly load the previous page, then exit out. Trapping all exceptions in VS halts on nothing so I'm at a loss at what the cause or solution could be...
To be clear I blew away my local repo, pulled down master, deployed Minimal
to emulator and device, and could produce this issue.
When typing some words on TextBox in Minimal sample project and pressing Enter key, the app should only navigate to DetailPage but not open the hamburger menu simultaneously.
I'm playing with a couple of changes to possibly fix this, but they'll be targeted at Mobile.
1: Put Windows in Tablet mode.
2: Launch Minimal
3: Enter text on Main page and click submit
4: You are brought to the details page, but no back button is visible.
(the above occurs regardless of the type of back button used (shell drawn vs in page header)
If you turn off tablet mode, the back button re-appears.
Tried to build Template10-master\Templates (Project)\Sample , but failing to build with following error:
Severity Code Description Project File Line
Error CS0234 The type or namespace name 'SecondPage' does not exist in the namespace 'Template10.Views' (are you missing an assembly reference?) Sample C:\Downloads\Template10-master\Template10-master\Templates (Project)\Sample\App.xaml.cs 23
The other samples apps like "Minimal" and "SecondaryTileActivation" are building and running fine. Please help fix up the "Sample" app.
Hello, I have the following error when I start my project based on Minimal. The Minimal project works correctly, but not my project. I did an update today of the git repo and now the app does not start while last week it did. I've copy/pasted the whole Minimal folder on top of my project, then fixed namespaces and other things.
Where is this "UseShellBackButton" setting is supposed to be save? In my other XAML apps (not windows store) it usually would be in app.config, but neither my app nor Minimal have one.
Object reference not set to an instance of an object.
Template10.Services.SettingsService.PropertyStore.Read(key = "UseShellBackButton", fallback = true) Line 45 C#
Template10.Services.SettingsService.SettingsHelper.Read(key = "UseShellBackButton", otherwise = true, strategy = Local) Line 38 C#
MyApp.Services.SettingsServices.SettingsService.UseShellBackButton.get() Line 29 C#
MyApp.App.App() Line 21 C#
MyApp.Program.Main.AnonymousMethod__0_0(p = {Windows.UI.Xaml.ApplicationInitializationCallbackParams}) Line 24 C#
Thank you for any help.
Template10 does not currently support having more than just the root frame for an app. This means if you have a splitview or uniform menu control and sub-pages, you cannot save the state of any of those pages, nor can you use the viewmodel framework as the Navigation events do not fire. This critically limits the usefulness of this framework.
Otherwise - awesome and huge potential.
I just tried to build and run the Tiles sample, but Tiles\Services\TileService\TileService.cs is missing.
Unfortunately, I haven't had time to go through this in detail to figure out what the problem is, but.... If I use Template10 and go through the "Navigation" session in "A Developer's Guide to Windows 10" (https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10/18/player?format=html5#time=8m51s), I get a crash when I perform the following:
Would you consider the current state of the template ready for use in real apps? I'm starting a new project and Template10 seems like a really good starting point - I like it a lot. I've been watching the progress and am wondering if the template is stable enough to start using or if I should hold off until it's ready.
Always met with this warning:
6>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x86\ilc\IlcInternals.targets(791,7): warning : Type 'Windows.UI.Xaml.Controls.Button' was not included in compilation, but was referenced in type 'Template10.Behaviors.NavButtonBehavior'. There may have been a missing assembly.
6>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x86\ilc\IlcInternals.targets(791,7): warning : Type 'Windows.UI.Xaml.Controls.TextBox' was not included in compilation, but was referenced in type 'Template10.Behaviors.TextBoxEnterKeyBehavior'. There may have been a missing assembly.
When trying to install the Template10 Nuget package to new Blank App (Universal Windows) project I get the following error:
Package restore failed for 'Template10'.
In Minimal, when selecting an item from the splitview it should autoclose. Just like MSN Finance.
Win + Backspace
Alt + Left
Keyboard hardware
Mouse hardware
Hi
I’m not sure this is the right place but I’m trying anyway :-). I just want to share a problem I had when developing a Windows 8.1 app. Maybe I has attacking the problem in the wrong way, but I asked on StackOverflow (http://stackoverflow.com/questions/20846859/sharing-session-data-between-frames-and-support-load-restore-state) and never found a build in solution so I created one on my own.
I’ll try to rephrase my problem here. Imaging you are creating a game where everything runs locally. You have the following pages:
The Welcome page is using a WelcomeViewModel. This view model could be recreated every time the page is loaded.
The Game page and the Statistics page is a GameEngineViewModel. These pages are using the same object. The statistics page is showing statistics of the current game.
The Cheat page is using a CheatViewModel. This view model should have a reference to the GameEngineViewModel.
My problem was how to share the GameEngineViewModel object on different pages. It was quite tricky because the state of this object needed be saved when the application was suspended. My CheatViewModel also needed to be saved when it was suspended. And when it was restored the reference to the GameEngineViewModel needed to be intact.
My solution was to add support for global objects in the SuspensionManager. Every global object needed to support the DataContract attribute. I’ve posted on StackOverflow how I did it. But in short I added methods to add, remove and get global objects (where every object was identified by an id). I also changed SuspensionManager to serialize and deserialize these objects when appropriate.
When this was I changed my pages and view models like this:
This is a big simplification from what I did. In real life it was a lot harder because I was also creating a WPF-application that was using the same viewmodels but that’s a different story :-).
But I hope you are getting my point. I think it would be great if there were some support in the template to handle objects that are shared between pages and where the state needs to be retained when the application is getting terminated.
I’m still not sure that I solved this in a good way, so if anyone has any other approach to share I’m more than willing to learn :-).
1: Launch Minimal application (initially, the Window comes up with the Pane as Compact)
2: Navigate to Settings
3: Settings page appears with the Back button in the page header
4: Click HamburgerButton to expose the SplitView's pane.
5: Unable to click the back button in the Settng's page header
So I am having a problem with my App.xaml file:
<common:BootStrapper
x:Class="SpoorAppT10.App"
xmlns:common="using:Template10.Common"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SpoorAppT10">
</common:BootStrapper>
Its complaining about not being able to find BootStrapper in Template10.Common, but it is inside that namespace:
namespace Template10.Common
{
// BootStrapper is a drop-in replacement of Application
// - OnInitializeAsync is the first in the pipeline, if launching
// - OnStartAsync is required, and second in the pipeline
// - NavigationService is an automatic property of this class
public abstract class BootStrapper : Application
{
I was hoping its a simple thing, and I'm missing something. Anyone have any ideas?
Severity Code Description Project File Line
Error Source file 'C:\Users\Brandon\Projects\Github\Template10\Template10Library\Common\ViewWrapper.cs' could not be found. Template10Library C:\Users\Brandon\Projects\Github\Template10\Template10Library\CSC
Error CS0012
The type 'DependencyObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'.
But WindowsRuntime is already referenced. what's going on?
I am following Jerry's blog article (http://blog.jerrynixon.com/2015/04/implementing-hamburger-button-with.html) about implementing a hamburger menu.
I am aware there could have been some changes over time, but I don't know how to do it otherwise.
It occurs in Shell.xaml.cs
// nav
Template10.Mvvm.Command<NavType> _navCommand;
public Template10.Mvvm.Command<NavType> NavCommand { get { return _navCommand ?? (_navCommand = new Mvvm.Command<NavType>(ExecuteNav)); } }
private void ExecuteNav(NavType navType)
{
var type = navType.Type;
var nav = (App.Current as App).NavigationService;
Application crashes at loading phase (splash by default) when the user changes the window size.
public static Visibility CalculateBackVisibility(Frame frame)
{
// by design it is not visible when not applicable
var cangoback = frame.CanGoBack; // Chash here
Since this time frame still null
I'm currently reviewing the WeakEvent class for my own purposes.
I came across an odd line in the static Unsubscribe method on line 282-285:
static public void Unsubscribe<THandler> ...
if (reg == null)
{
reg.Subscribe(handler as Delegate);
}
Two thoughts:
To reproduce the issue comment SplashFactory = (e) => new Views.Splash(e); at
public App()
{
InitializeComponent();
// DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-Cache
CacheMaxDuration = TimeSpan.FromDays(2);
// DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-BackButton
ShowShellBackButton = SettingsService.Instance.UseShellBackButton;
// DOCS: https://github.com/Windows-XAML/Template10/wiki/Docs-%7C-SplashScreen
//SplashFactory = (e) => new Views.Splash(e);
}
Is there a reason the three MVVM base classes (BindableBase, ViewModelBase, and DelegateCommand) are in the projects rather than in the template library? It would make more sense to me if they were part of the base library, which could be maintained independently of the actual projects using them.
I've referenced the Template10 project via nuget.
My shell.xaml is the same as the minimal project sample.
When I run my app, I get this error:
WinRT information: Cannot locate resource from 'ms-appx:///Template10Library/Controls/HamburgerMenu.xaml'. [Line: 19 Position: 52]
Do I need to create this resource myself in my project ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.