UWP Menu XAML Controls - xaml

I am trying to implement a layout like the one in the MSN News app on my app for Windows 10
I want to replicate a menu like the one that says "All, Top Stories, US" and such. I have tried ListBox, AppBar and CommandBar and nothing seems to resemble this layout. Which controller should I use?

Check out the Pivot control. You can find out what elements any UWP XAML apps are made of by debugging them with VS and using the Live Visual Tree view.

Related

Implement a Master Detail Page inside a Tabbed Page in Xamarin Forms (with Prism)

I have been trying to create a Xamarin Forms App using Prism that works on both phones and tablets.
For the tablet layout I'm trying to create something similar to the draft image below while still reusing the Pages/ViewModels from the phone.
What I have tried:
Using a TabbedPage where each Tab contains a MasterDetailPage. There are two issues with this solution:
Xamarin only recommends using a MasterDetailPage as the root page
I managed to implement this "solution" but probably due to the reason above the xaml of the pages inside the MasterDetailPage don't bind correctly to their ViewModels.
Using a TabbedPage in which each Tab contains a Page divided in two parts which have a ContentView:
This solution works, but I can't reuse the Page from the Phone version directly on the layout.
I did try using Prism Partial Views to implement this solution, but I think the parent Page needs to contain the ViewModel that is going to be used by the ContentView which wouldn't work in this scenario (because it's going to contain two View Models).
Not sharing the Pages/ContentViews/ViewModels between phone and tablet:
This solution works, because I can implement the MasterDetailPage with ContentViews but there's is no code being shared for pages/views that basically do exactly same thing so it's really not ideal.
Any idea on how I can implement this layout while still sharing the Views and View Models between the Phone and Tablet implementations?
Note: This app is for Android, iOS and UWP using Xamarin Forms 3.4 and Prism 7.1

Click and drag selection box in UWP

Is it possible to implement mouse click and drag selection box in GridView UWP Windows 10. Should it be done through simply drawing a rectangle, calculating coordinates of its points and evaluating position of other objects inside this box? Or are there some other ways?
Could you give a bit of sample code or a link?
The Universal Windows Platform does allow for Drag-And-Drop behavior. This includes drag from app and drop outside of app, drag and drop inside the app, and drag from outside the app and drop in the app.
The way to do this very simple (with room for heavy customization if you feel like it is needed): UWP XAML controls have a CanDrag and AllowDrop properties. The former is just a property of whichever control you're dealing with, the latter is an event that needs to be handled properly via code. If you want to further customize your app you can also handle the DragOver, which handles behavior when a dragged item is over a drop area but has not been "released" yet.
For further details and a bit example code please read Microsoft's own documentation for Drag-And-Drop. For a more built up example, you can check out the following Github repo.

Scroll bars for Excel CustomTaskPane developed using VSTO

I have an add-in, developed using VSTO, that displays a custom task pane in Excel. This custom task pane holds a user control containing tree-view and other controls. I enabled AutoScroll for the user control and can see the traditional windows scroll bar when ever i re-size the control. However, i want the scroll bar to be similar to the scroll bars that exist in Thesaurus CTP in Excel 2013,when the CTP is in floating position and re-sized to smallest size, (i cant post images as i have reputation below 10). can any one provide pointers for this?
Also is there any way to restrict the minimum size of CustomTaskPane ?
Hello Guruteja,
You can handle the Resize event of the Control class to control the size of your form and set the min size programmatically.
It looks like you need to develop a custom control to imitate the built-in one. Or try searching for any third-party Windows Forms controls.

Windows Store App: Should I use ListBox or ListView?

I have a question about Windows Store Apps:
what is the difference between the:
ListBox
ListView
i want to have a list with different TextBlocks
The more Windows-8 App style control is the ListView. It has built-in functionality for things like scrolling. The ListBox does basically the same things except it doesn't have the nice scrolling functionality.
See here for a more in-depth treatment.

UserControl vs LayoutAwarePage (Windows 8 XAML)

What is the difference between <common:LayoutAwarePage and <UserControl... in XAML in Windows 8. Looks like both are used as W8 pages.
A Page is what you need to use inside of a Frame to support the standard navigation framework and the standard AppBar class. LayoutAwarePage adds support for different visual states depending on layout (portrait, landscape full/filled/snapped), which really is required when you are building an app to submit to the store.
A UserControl is just a simple way to group some UI pieces and code-behind together useful especially if you want to have a reusable piece of UI that shows up on different pages or if your page design becomes too complicated (eg. if you have a lot of XAML for different page layouts). It is also useful if you want to create a common control to be reused in multiple places or multiple projects, but don't care about being able to restyle it - then you would need to create a custom/templated control.
layoutawarepage are page that allow supports for the various view such as filled, snapped, portrait and landscape. in which you would have to handle the visualstatemanager in xaml and do the switching from various view in codebehind.
while usercontrol are elements that you can place in other pages.