I have noticed what appears to be a bug on the RadSideDrawer on UWP. Basically only the DrawerOpened and DrawerClosed events fire, and they do not do so in a predictable manner. I have not been able to get the DrawerOpening or DrawerClosing events to fire at all. Also the binding for IsOpen is deficult to predict, if I close the draw by swiping to close it then IsClosed does not appear to be updated to reflect the fact that the draw is closed, none of the closed/closing events fire either.
Behavior: Swiping to open or close does not fire DrawerOpening,DrawerClosing,DrawerOpened,DrawerClosed events. IsOpen() does not get updated
Expected Behavior: Swiping to open or close would fire all events like android and iOS(tested and working with code below). IsOpen() should also be updated to reflect correct state.
My project setup and steps to reproduce are as follows:
Xamarin Forms Netstandard 2.0 project.
IDE:Visual studio 15.5.1
Xamarin.Forms(2.5.0.121934)
Prism.DryIoC.Forms(7.0.0.340-ci)
Telerik.UI.for.Xamarin.Common.Trial(2017.3.913.3)
Telerik.UI.for.Xamarin.Primitives.Trial(2017.3.913.3)
XAML Code:
<telerikPrimitives:RadSideDrawer DrawerLength="275" DrawerLocation="Right" IsOpen="{Binding MenuOpen, Mode=TwoWay}">
<telerikPrimitives:RadSideDrawer.Behaviors>
<b:EventToCommandBehavior Command="{Binding DrawerClosedCommand}" EventName="DrawerClosed" />
<b:EventToCommandBehavior Command="{Binding DrawerClosingCommand}" EventName="DrawerClosing" />
<b:EventToCommandBehavior Command="{Binding DrawerOpenedCommand}" EventName="DrawerOpened" />
<b:EventToCommandBehavior Command="{Binding DrawerOpeningCommand}" EventName="DrawerOpening" />
</telerikPrimitives:RadSideDrawer.Behaviors>
<telerikPrimitives:RadSideDrawer.MainContent>
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Label TextColor="Black" HorizontalOptions="Center" Text="Welcome to Training wheels." />
<Label TextColor="Black" HorizontalOptions="Center" Text="Minervex Software" />
<Button Text="IClipBoardService" Command="{Binding NavigateToPageCommand}" CommandParameter="IClipboardServicePage"/>
<Button Text="IManagePictureService" Command="{Binding NavigateToPageCommand}" CommandParameter="IManagePictureServicePage"/>
<Button Text="CreateUserPage" Command="{Binding NavigateToPageCommand}" CommandParameter="CreateUserPage"/>
<Button Text="UserProfilePage" Command="{Binding NavigateToPageCommand}" CommandParameter="UserProfilePage"/>
</StackLayout>
</telerikPrimitives:RadSideDrawer.MainContent>
<telerikPrimitives:RadSideDrawer.DrawerContent>
<StackLayout>
<Button Text="Mail" />
<Button Text="Calendar" />
<Button Text="People" />
<Button Text="Tasks" />
</StackLayout>
</telerikPrimitives:RadSideDrawer.DrawerContent>
</telerikPrimitives:RadSideDrawer>
View model code
{
private bool _menuOpen;
public class MainPageViewModel : BaseViewModel
{
public bool MenuOpen
{
get { return _menuOpen; }
set { SetProperty(ref _menuOpen, value); }
}
public Command DrawerOpeningCommand { get; set; }
public Command DrawerOpenedCommand { get; set; }
public Command DrawerClosingCommand { get; set; }
public Command DrawerClosedCommand { get; set; }
public MainPageViewModel(INavigationService NavigationService, IEventAggregator EventAggregator, IDependencyService DependencyService, IPageDialogService PageDialogService, IContainer Container)
: base(NavigationService, EventAggregator, DependencyService, PageDialogService, Container)
{
Title = "Main Page";
MenuItemClickedCommand = new DelegateCommand(MenuItemClicked);
DrawerClosedCommand = new Command(DrawClosed);
DrawerClosingCommand = new Command(DrawClosing);
DrawerOpeningCommand = new Command(DrawOpening);
DrawerOpenedCommand = new Command(DrawOpened);
}
private void MenuItemClicked()
{
if (MenuOpen)
{
MenuOpen = false;
}
else
{
MenuOpen = true;
}
}
private void DrawOpening()
{
}
private void DrawOpened()
{
}
private void DrawClosing()
{
}
private void DrawClosed()
{
}
}