Pull to refresh for UWP - xamarin

Hi I would like to know if there are now ways to implement PullToRefresh functionality for UWP
i read and tried several blogs but it doesn't work for UWP. some of them were from 2016 - 2019 and they are saying that UWP doesn't support this functionality, so I would like to know if this is now supported, if yes, how?
I already tried. RefreshView / IsPullToRefreshEnabled but they are only working on Android and IOS.
Thanks!

You can use Xamarin.Forms' own RefreshView.
Like you can see in the documentation, you can even customise its direction:
On the Universal Windows Platform, the pull direction of a RefreshView can be set with a platform-specific. For more information, see RefreshView Pull Direction.
Sample usage:
<ContentPage ...
xmlns:windows="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core">
<RefreshView windows:RefreshView.RefreshPullDirection="LeftToRight"
IsRefreshing="{Binding IsRefreshing}"
Command="{Binding RefreshCommand}">
<ScrollView>
...
</ScrollView>
</RefreshView>
</ContentPage>

Or PullToRefreshListView. Only for UWP

Related

Get user click event as each image in android gallery is selected

I'm using this awesome tutorial for xamarin forms in order to get multiple images from gallery on android devices: https://www.xamboy.com/2019/03/12/select-multiple-images-and-videos-in-xamarin-forms/
Everything is working fine. I wonder if there's a way, on code implementation for Android, to intercept when user click on each image.
Right now there is just method for OnActivityResult. Any idea?
Maybe use something like that:
<Image>
<Image.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" Tapped="MyMethodThatFiresWhenImageIsTapped"/>
</Image.GestureRecognizers>
</Image>

Controls are disabled in MenuItems used in Shell in Xamarin Forms

The code below when entered in AppShell for Xamarin Forms only works in Android. In iOS the Switch is rendered but can't be toggled (as if it is disabled). Are there any tricks to making this work in iOS as well or is this a bug?
I tried placing the the Switch in a completely different ContentView and loading it in the Shell with local: and also tried including the Switch in the DataTemplate directly. All of them work in Android, just not iOS.
Thanks for your help
<MenuItem>
<Shell.MenuItemTemplate>
<DataTemplate>
<ContentView>
<Switch IsToggled="True" />
</ContentView>
</DataTemplate>
</Shell.MenuItemTemplate>
</MenuItem>

xamarin UWP masterdetailpage width How to set

I have a program with xamairn forms, One client project is UWP. The Master of
MasterDetailPage control has normal appearance within Android and IOS platform , But it looks unfriendly within UWP platform. I know I can use Grid to replace. But, I am not sure there are some issues in the Masterdetailpageor I miss some key procedure to use it.
at UWP like this:
But it looks unfriendly within UWP platform. I know I can use Grid to replace. But, I am not sure there are some issues in the Masterdetailpageor I miss some key procedure to use it.
If you have not set MasterBehavior for MasterDetailPage. The Master will split open by default as you mentioned. Please set MasterBehavior according to the following code. And you will get normal appearance.
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MasterDetailPageNavigation;assembly=MasterDetailPageNavigation"
x:Class="MasterDetailPageNavigation.MainPage" MasterBehavior="SplitOnPortrait">
</MasterDetailPage>

How to set CommandBar under SplitView?

I'm developing an application for Windows 10 Platform.
While developing this application, I ran into an issue where CommandBar is above SplitView.
How do I set CommandBar under SplitView under controls on the page?
IMPROVED
Due to I was making for my own app, here is the study and solution I elaborate here: http://bit.ly/1L6EZ00. It involves changes in many parts and I think it looks cool.
Old, in case you just need only that:
That is most similar behavior like the photos app that I have been capable to achieve (it is like the lottery testing):
<Page.TopAppBar >
<CommandBar Margin="48,0,0,0" >
<CommandBar.PrimaryCommands>
<AppBarButton Icon="Globe" Label="Quick Launch" Command="{Binding QuickLaunch}">
</AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Page.TopAppBar>
Now the splitview:
<SplitView x:Name="Splitter" Margin="0,-48,0,0" CompactPaneLength="48" OpenPaneLength="240" ...
then pane as usual and the content, for instance:
<SemanticZoom Margin="0,48,0,0">
It is not exactly the same as the Photos apps and I am using the 10166 SDK so I think it is the most accurate option.

Accordion List in Windows Phone

Does windows phone have a 'accordion list' control? If not what else can one do to achieve the same look and experience of a expandable list?
I've been googling around and it seems like there's no straight answer to this.
Thanks in advance!
You could try using the ExpanderView control from the Microsoft Windows Phone toolkit which is free.
May be you just have to style it a little so that it looks like an Accordion List.
You can use the control in a simple way, by populating it with Items:
<toolkit:ExpanderView Header="Expander Header" x:Name="expander">
<toolkit:ExpanderView.Items>
<TextBlock FontSize="40" Text="Expanded Content"/>
</toolkit:ExpanderView.Items>
</toolkit:ExpanderView>
Or you can use Data Binding.
Hope this helps.
There are a lot of 3rd party quality custom controls built for WP7. Try to download WinPhone DevHub and Telerik Examples from the Marketplace, I am pretty sure you will find what you want already implemented.
Telerik controls are not free, but WinPhone DevHub has a lot of free controls. You will find details on where to download them also in the app.

Resources