예제 #1
0
        public CameraListPage()
        {
            InitializeComponent();
            Analytics.TrackEvent("Список камер");
            BindingContext = viewModel = new CameraListViewModel();
            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                int statusBarHeight = DependencyService.Get <IStatusBar>().GetHeight();
                //var p = cameraStack.Padding;
                //cameraStack.Padding= new Thickness(p.Left,p.Top+ statusBarHeight,p.Right,p.Bottom);

                break;

            default:
                break;
            }
            MessagingCenter.Subscribe <HeaderViewStack>(this, "GoBack", async sender =>
            {
                if (Application.Current.MainPage.Navigation.ModalStack.Count > 1)
                {
                    await Navigation.PopModalAsync();
                }
                else
                {
                    await Navigation.PopAsync();
                }
            });
            viewModel.LoadCameras.Execute(null);
        }
예제 #2
0
        public static void SetEntry(Panel container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            CameraModel         model     = new CameraModel();
            CameraListViewModel viewModel = new CameraListViewModel(model);
            CameraListView      view      = new CameraListView();

            view.DataContext = viewModel;
            container.Children.Add(view);
        }