Example #1
0
        public NavigationDrawer_Default()
        {
            InitializeComponent();

            vm = new MenuCollectionViewModel();
            navigationDrawer.ContentView = new Archive_Default(vm.MenuCollection[0].MessageContent, "Inbox");

            navigationDrawer.ContentView.BackgroundColor = Color.White;

            this.listView.ItemsSource = vm.MenuCollection;

            for (int i = 0; i < 7; i++)
            {
                messageContent.Add(vm.MenuCollection[0].MessageContent[i]);
            }

            this.listView1.ItemsSource = messageContent;
            if (Device.RuntimePlatform == Device.iOS)
            {
                if (Device.Idiom == TargetIdiom.Phone)
                {
                    apiNameLabel.FontSize                = 12;
                    defaultDrawerLabel.FontSize          = 12;
                    secondaryDrawerLabel.FontSize        = 12;
                    transitionLabel.FontSize             = 12;
                    positionLabel.FontSize               = 12;
                    defaultTransitionPicker.WidthRequest = 101;
                    transitionPicker.WidthRequest        = 101;
                    defaultPositionPicker.WidthRequest   = 101;
                    positionPicker.WidthRequest          = 101;
                }
                navigationDrawer.DrawerWidth        = (float)(Core.SampleBrowser.ScreenWidth);
                navigationDrawer.DrawerHeight       = (float)(Core.SampleBrowser.ScreenHeight);
                navigationDrawer.DrawerHeaderHeight = 150;
            }
            else
            {
                secondaryDrawer.DrawerWidth = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
                defaultDrawer.DrawerWidth   = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
            }
            if (Device.Idiom == TargetIdiom.Phone && (Device.RuntimePlatform == Device.UWP || (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone)))
            {
                userImage.VerticalOptions    = LayoutOptions.Center;
                navigationDrawer.DrawerWidth = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
                navigationDrawer.Margin      = new Thickness(-2, 0, -2, 0);
            }
            //navigationDrawer.DrawerHeight = (float)(Core.SampleBrowser.ScreenHeight * 0.6);
            loadPropertyView();
        }
Example #2
0
        public NavigationDrawer_Tablet()
        {
            InitializeComponent();
            vm = new MenuCollectionViewModel();
            navigationDrawer.ContentView = new Archive_Default(vm.MenuCollection[0].MessageContent, "Inbox");
            navigationDrawer.ContentView.BackgroundColor = Color.White;
            if (Device.RuntimePlatform == Device.Android)
            {
                navigationDrawer.TouchThreshold = 10;
            }
            else
            {
                navigationDrawer.TouchThreshold = 100;
            }
            this.listView.ItemsSource = vm.MenuCollection;

            for (int i = 0; i < 7; i++)
            {
                messageContent.Add(vm.MenuCollection[0].MessageContent[i]);
            }

            this.listView1.ItemsSource = messageContent;
            if (Device.RuntimePlatform == Device.iOS)
            {
                navigationDrawer.DrawerWidth        = (float)(Core.SampleBrowser.ScreenWidth * 1.1);
                navigationDrawer.DrawerHeaderHeight = 150;
            }
            else
            {
                if ((float)(Core.SampleBrowser.ScreenWidth) > 0)
                {
                    secondaryDrawer.DrawerWidth = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
                    defaultDrawer.DrawerWidth   = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
                }
            }
            if (Device.RuntimePlatform == Device.UWP || (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone))
            {
                secondaryDrawer.DrawerWidth = 400;
                defaultDrawer.DrawerWidth   = 400;
            }
            if (Device.RuntimePlatform == Device.iOS && Device.Idiom == TargetIdiom.Tablet)
            {
                userImage.HorizontalOptions     = LayoutOptions.Center;
                userNameLabel.HorizontalOptions = LayoutOptions.Center;
                userImage.Margin = new Thickness(7, 14, 0, 0);
                drawerContentViewGrid.Padding      = new Thickness(13, 1, 0.5, 1);
                secondaryDrawer.DrawerHeaderHeight = 60;
                notificationText.HeightRequest     = 60;
                notificationText.Margin            = new Thickness(10, 20, 0, 0);
            }
            if (Device.RuntimePlatform == Device.Android && Device.Idiom == TargetIdiom.Tablet)
            {
                userImage.HorizontalOptions     = LayoutOptions.Center;
                userNameLabel.HorizontalOptions = LayoutOptions.Center;
            }
            else if ((Device.RuntimePlatform != Device.iOS))
            {
                navigationDrawer.DrawerWidth        = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
                navigationDrawer.DrawerHeaderHeight = 150;
            }
            if (Device.Idiom == TargetIdiom.Phone && (Device.RuntimePlatform == Device.UWP || (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone)))
            {
                userImage.VerticalOptions    = LayoutOptions.Center;
                navigationDrawer.DrawerWidth = (float)(Core.SampleBrowser.ScreenWidth * 0.8);
            }
            if ((Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Phone) || Device.RuntimePlatform == Device.UWP)
            {
                if (Device.Idiom == TargetIdiom.Desktop)
                {
                    navigationDrawer.DrawerWidth = 400;
                    userImage.VerticalOptions    = LayoutOptions.Center;
                }
            }
            navigationDrawer.DrawerHeight       = (float)Core.SampleBrowser.ScreenHeight;
            navigationDrawer.DrawerFooterHeight = 0;
            navigationDrawer.Duration           = 400;
            navigationDrawer.Position           = Position.Left;
            navigationDrawer.Transition         = Syncfusion.SfNavigationDrawer.XForms.Transition.SlideOnTop;
            this.Padding = new Thickness(-5);
            loadPropertyView();
        }