示例#1
0
        /// ------------------------------------------------------------------------------------------------

        /// ------------------------------------------------------------------------------------------------
        #region Public Functions
        /// ------------------------------------------------------------------------------------------------
        ///

        /// <summary>
        /// Initialize the instance of Splitview page
        /// </summary>
        /// <returns>Current Instance of the splitview page</returns>
        ///
        public static SplitView Instace()
        {
            try
            {
                if (_instance == null)
                {
                    _instance = new SplitView();
                    if (Device.OS == TargetPlatform.Android)
                    {
                        MapView = new AndroidMapView();
                    }
                    else
                    {
                        MapView = new WindowsMapView();
                    }
                    Fullmapview = new FullMapView(MapView);

                    FullMapView();
                    _instance.PushInspectionCountView(InspectionCount = new InspectionCountView());

                    _instance.PushLeftContent(HubMaster = new HubMasterView());
                }

                NavigationPage.SetHasNavigationBar(_instance, false);

                return(_instance);
            }
            catch (Exception ex)
            {
                LogTracking.LogTrace(ex.ToString());
                return(null);
            }
        }
示例#2
0
        private async void CloseCase(CaseListModel entry)
        {
            try
            {
                entry.View.Animate("colapse",
                                   x =>
                {
                    //var change = entry.OriginalSize.Height * x;
                    //entry.View.HeightRequest = entry.OriginalSize.Height - change;
                    entry.View.HeightRequest = 0;
                }, 0, AnimationDuration, Easing.SpringIn, (d, b) =>
                {
                    entry.View.IsVisible = false;
                });
                await SplitView.Instace().Clear();

                if (Device.OS == TargetPlatform.Android)
                {
                    var formsMap = (AndroidMapView)SplitView.MapView;
                    SplitView.Fullmapview.FindByName <Grid>("GlMapView").Children.Clear();
                    SplitView.Fullmapview.FindByName <Grid>("GlMapView").Children.Add(formsMap, 0, 0);
                    SplitView.MapView.LoadPins(AppContext.AppContext.LstGooglePin);
                    AndroidMapView.ChangeMapType();
                }
                else
                {
                    //Added to reload the Map pins
                    WindowsMapView.ChangeMapType();
                    SplitView.MapView.ClearPin();
                    SplitView.MapView.LoadPins(AppContext.AppContext.LstCustomPin);
                    SplitView.MapView.MoveToRegion(AppContext.AppContext.LstCustomPin?.FirstOrDefault().Pin.Position, Xamarin.Forms.Maps.Distance.FromKilometers(0.5));
                }
            }
            catch (Exception ex)
            {
                LogTracking.LogTrace(ex.ToString());
            }
        }