Is there a way in a NavigationView in UWP to have multiple "Views" for NavigationViewMenuItems? The concept would be to have Categories or Folders as MenuItems, and when clicked or the NavigationViewMenuItems would slide out to the left and show the contents of the folder or category. Then when navigating back out of the folder, the folder and categories list would slide in from the left again. I know I can change the NavigationView.MenuItemsSource in C#, but I'd like to instead have this done primarily in XAML. I've tried numerous ways to do this, but can't seem to find a way that works.
I don't really have any code to demonstrate this, as this is a whole concept issue rather than a single bug that isn't working. I have searched everywhere, and have found numerous articles/links about loading different views into NavigationView.Content, but nothing of changing the MenuItems portion.
Does anyone have any ideas on how to achieve this, or a link to a tutorial I could follow? I can't imagine that this has never been done before, this seems like such a common-sense UI interface.
What you need actually is a Tree Navigator. The UWP has no such a built-in control for us. You could use the third-party control like Syncfusion TreeNavigator.
See the code sample on GitHub: https://github.com/syncfusion/uwp-demos/tree/master/Navigation
Related
I recently inherited a Xamarin project where I am to work on the iOS project. Going over several tutorial I figured I was ready, however the person before me did not use storyboards or controllers! They did all customization of views in files named LoginScreens.cs (basically controller files from the looks of it).
For learning purposes and ease of transition I would like to get a storyboard going in this project. So I created a storyboard titled Main and added a ViewController and essential copy and pasted the view customization code used in the LoginScreen.cs into my controller.
To be a little more specific, I have a Main.Storyboard that looks like this:
Where I am using editText boxes and a button to act as place holders for what I actually do to them in the ViewController.cs.
This all seems to register and builds properly however when I run the debugger on iPhone 6s iOS 9.3 I get the following:
The changes appear to show, but all my storyboard iOS designer views remain in place. I am trying to see if there is a way to reflect the changes made in the controller on the storyboard.
TL;DR: I'm trying to alter some views in a programmatic way in my ViewController.cs file. These views were originally added via the iOS designer and for customization purposes, they were edited in the controller. I want to see the visual alteration I make on a view in the controller, reflect in the iOS designer and when I debug.
Sounds like you are trying to go from a project where views were all done programmatically to implementing storyboards. This is a Big change and will take some time to convert the views over.
In the cs file there will be things like Add(passwordTextFeild) which are going to add more views to your storyboard view, hence why you get alot of views in your login view. You wont be able to see these in the storyboard as they are done at runtime.
If you are looking for IBDesignable this is more for custom controls and you still will have to add code to be able to see the changes from the .cs file in the storyboard.
Check my Question for IBInspectable/IBDesignable in Xamarin
Check this official link: https://developer.xamarin.com/guides/ios/user_interface/designer/ios_designable_controls_walkthrough/
Probably not what you wanted to hear but the UI in iOS projects tend to be done in one of the three methods:
All programmatically
Storyboards
Xibs
There are tons of questions/blog posts (even a video), weighting up the pros and cons of each. So possibly the last developer felt it was best to do it programmatically
There is a setting, IBDesignable, that you can add to the declaration of UI classes in Swift or Objective-C. That tells Xcode the those UI objects have a custom interface that you want to be presented in Interface Builder.
I have no idea how (or even if you could) you would use IBDesignable in Xamarin/C#. If its not supported for Xamarin then you're probably out of luck.
I suggest you search on "Xamarin IBDesignable" on the net.
I already looked through the internet but could not find a tutorial that showed the creation of a ListView in Expression Blend. I do not want to modify existing ListViews that are part of Blend, as I have done that already.
I need a tutorial that shows the first steps of creating a custom ListView and, in my case, specifically states all the parts the ListView consists of.
A button for example, can be created in Blend by drawing a Rectangle, adding a ContentPresenter and converting that into a Button user control. I would like to do the same thing for a ListView.
I went through that post already but since it is about WinForms I could not draw any helpful conclusions.
I am thankful for links to similar posts, tutorials and even code snippets.
After a long night of further research I came across this answer. I installed the Windows SDK and there are files that contain the ControlTemplates for WPF Controls. Using them as a blueprint gives me the possibility of creating my own desired version of the ListView.
My team and I have recently migrated our app from Windows 8 to Windows 8.1. It worked fine until I went to update the existing pages and add a new one. Instead of any errors, just nothing happened.
The way I understand it is, in Windows 8, split pages had their information stored in a DataSource class, and I could even put all the stuff for all the split pages into the one class if I wanted to.
It's changed in Windows 8.1, though, so all the content for the pages go into the code behind pages for that actual page.
I can't actually seem to find any examples, articles or anything online on how to do this. Would anyone be able to link me to such an article or explain how the groups and items are meant to go into the class?
Thanks!
Reply to htuomola:
When I tried adding a new split page, at the time I didn't realise that how you put the content into the page is handled differently, so I just went and did the same as before. I admit, it might not be best practice to have done it like this, but at the time I felt it made the most sense. I had all the groups and items for the various split pages in the one data source class, and the individual pages just pointed to which items/groups I wanted. So, not knowing any better, I made an identical split page to the others, and it didn't pick up the new groups/items, but it did find the old ones. The old split pages were working fine at this point too. It was only when I tried to make a new 8.1 style split page, that they all stopped working and threw errors like "The type 'IME.Miscellaneous.Additional.Help' already contains a definition for 'itemDetailGrid'" and ""IMEDataSource" does not exist in the namespace "using:IME.Data".", even though I didn't change the pages that are having these errors - at all.
The Split Page item template still exists with Windows 8.1 applications even if the NavigationHelperand visual state handling code is a bit different. I think it also works pretty nicely out-of-the-box. Did you try adding a new Split Page page to you project, what problems are you facing?
Some documentation that you can find is in MSDN project templates and item templates pages. You should probably find a few samples in MSDN that use the Split Page/App template.
About the information storage, do you mean that in Windows 8.0 there was a separate view model class and 8.1 only has an ObservableDictionary property on code behind? Nothing prevents you from replacing that with a better solution. I'd just delete it and follow MVVM guidelines, setting up a ViewModelLocator and view models.
I'm trying to add an overlay to a ListItem in an Xamarin Android ListView control. I was able to easily achieve this in iOS and made it appear like the following, in normal view:
And then when you click on the item:
It shows an overlay with additional images (which is actually a UIViewController). I was wondering if it's possible to do the same within Android; I would like to keep the same UI WITHOUT using a dialog, which is what all of the responses seem to indicate so far. Seems like it should be possible... Any ideas how to do it with an Activity (I need an activity to respond to the events within the UI as well).
Thanks.
If I understood correctly, then this is what you're looking for: https://github.com/flavienlaurent/poppyview
You can implement Quick Actions for this purpose. Quick Actions are not provided in the Android SDK
You can find lots of examples on how to create them. Such as here and here.
Although these are not in Xamarin, they can help u in creating them.
I'm developing a Silverlight application for the first time. I've gone through some tutorials, but I can't seem to find anything that helps me with this particular problem. I would like a set of buttons to be present on all of my pages (like a template). When a button is pressed, I would like the ContentGrid to slide out and a new ContentGrid slide in (with the relevant .xaml file being loaded).
Are there any tutorials showing the best way to do this? From samples I've seen, they only seem to transition between two pages, so copy-pasting the group of buttons on each xaml page isn't too much of a problem. However, with more pages, it would be inefficient to copy-paste the base layout each time.
Thanks for any suggestions
I used to create a master view and create each page content as a user control; that way, I can swap out/in the user control for the appropriate page, and I would have a consistent header that way... similar to a master page in ASP.NET. I'm sure there are other templates too; I'm not aware of everything available for Silverlight...
The one answer I cannot provide is the transition; the only thing I can offer is Telerik has a control for that purpose, the transition control: http://demos.telerik.com/silverlight/#Controls I understand if you can't drop a couple of hundred bucks to get it though :-)
HTH.
Have you tried the Silverlight Business Application Visual Studio Project template?