public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.HasOptionsMenu = true;
     this.viewModel      = ViewModelProviders.Of(this)
                           .Get(Java.Lang.Class.FromType(typeof(BarcodeScanViewModel))) as BarcodeScanViewModel;
 }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.HasOptionsMenu = false;
     this.viewModel      = ViewModelProviders.Of(this)
                           .Get(Java.Lang.Class.FromType(typeof(SettingsOverviewViewModel))) as SettingsOverviewViewModel;
 }
Exemplo n.º 3
0
        public View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            homeViewModel = ViewModelProviders.Of(this).Get(Java.Lang.Class.FromType(typeof(HomeViewModel))) as HomeViewModel;
            View root = inflater.Inflate(Resource.Layout.fragment_home, container, false);

            return(root);
        }
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _viewModel = ViewModelProviders.Of(this).Get(DependencyLocator.Current.CreateBooksViewModel);
            _viewModel.ViewDidLoad();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            // setup RecyclerView
            RecyclerView = FindViewById <RecyclerView>(Resource.Id.RecyclerView);
            RecyclerView.SetLayoutManager(new LinearLayoutManager(this));

            // setup ViewModel
            ViewModel = ViewModelProviders.Of(this).Get(Java.Lang.Class.FromType(typeof(ItemViewModel))) as ItemViewModel;
        }
Exemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            RecyclerView = FindViewById <RecyclerView>(Resource.Id.RecyclerView);
            progress     = FindViewById <ProgressBar>(Resource.Id.progress);

            RecyclerView.SetLayoutManager(new LinearLayoutManager(this));

            ViewModel = ViewModelProviders.Of(this).Get(Java.Lang.Class.FromType(typeof(ItemViewModel))) as ItemViewModel;

            invoker = new Invoker(this);
            invoker.AddViewModel(ViewModel, Response, Error);
            ViewModel.InitObserver();
        }
Exemplo n.º 7
0
        public void Initialize()
        {
            ViewModel = ViewModelProviders.Of(this).Get(Java.Lang.Class.FromType(typeof(MainActivityViewModel))) as MainActivityViewModel;

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            Button SaveText = FindViewById <Button>(Resource.Id.btn_save_text);

            SaveText.Click += SaveOnClick;

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;
            //fileLocation = Path.Combine(Xamarin.Essentials.FileSystem.AppDataDirectory, "demo.txt");
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            time      = FindViewById <TextView>(Resource.Id.time);
            startStop = FindViewById <Button>(Resource.Id.start_stop);
            reset     = FindViewById <Button>(Resource.Id.reset);

            model = (StopwatchViewModel)ViewModelProviders.Of(this).Get(Java.Lang.Class.FromType(typeof(StopwatchViewModel)));
            model.running.Observe(this, new OnChangedHandler(() =>
            {
                startStop.Text = GetString(model.Running ? Resource.String.stop : Resource.String.start);
                reset.Enabled  = !model.Running;
            }));
            model.diff.Observe(this, new OnChangedHandler(() =>
            {
                time.Text = F.Format(new Date(model.Diff));
            }));
            StopwatchLifecycleObserver observer = new StopwatchLifecycleObserver(model);

            startStopClicked = (object sender, EventArgs e) =>
            {
                model.Running = !model.Running;
                if (model.Running)
                {
                    observer.ScheduleAtFixedRate();
                }
                else
                {
                    observer.Stop();
                }
            };
            startStop.Click += startStopClicked;

            resetClicked = (object sender, EventArgs e) => { model.Diff = 0; };
            reset.Click += resetClicked;

            Lifecycle.AddObserver(observer);
            UpdateButtons();
            UpdateTime();
        }
        void SetupAnnotationToolbar()
        {
            var toolManagerViewModel = (ToolManagerViewModel)ViewModelProviders.Of(mFragmentActivity).Get(Java.Lang.Class.FromType(typeof(ToolManagerViewModel)));

            toolManagerViewModel.ToolManager = mToolManager;
            var presetViewModel            = (PresetBarViewModel)ViewModelProviders.Of(mFragmentActivity).Get(Java.Lang.Class.FromType(typeof(PresetBarViewModel)));
            var annotationToolbarViewModel = (AnnotationToolbarViewModel)ViewModelProviders.Of(mFragmentActivity).Get(Java.Lang.Class.FromType(typeof(AnnotationToolbarViewModel)));
            var signatureViewModel         = (SignatureViewModel)ViewModelProviders.Of(mFragmentActivity).Get(Java.Lang.Class.FromType(typeof(SignatureViewModel)));

            mAnnotationToolbarComponent = new AnnotationToolbarComponent(
                mFragmentActivity,
                annotationToolbarViewModel,
                presetViewModel,
                toolManagerViewModel,
                new AnnotationToolbarView(mToolbarContainer)
                );
            mPresetBarComponent = new PresetBarComponent(
                mFragmentActivity,
                mFragmentActivity.SupportFragmentManager,
                presetViewModel,
                toolManagerViewModel,
                signatureViewModel,
                new PresetBarView(mPresetContainer)
                );

            // Create our custom toolbar and pass it to the annotation toolbar UI component
            mAnnotationToolbarComponent.InflateWithBuilder(
                AnnotationToolbarBuilder.WithTag("Custom Toolbar")
                .AddToolButton(ToolbarButtonType.Square, DefaultToolbars.ButtonId.Square.Value())
                .AddToolButton(ToolbarButtonType.Ink, DefaultToolbars.ButtonId.Ink.Value())
                .AddToolButton(ToolbarButtonType.FreeHighlight, DefaultToolbars.ButtonId.FreeHighlight.Value())
                .AddToolButton(ToolbarButtonType.Eraser, DefaultToolbars.ButtonId.Eraser.Value())
                .AddToolButton(ToolbarButtonType.Signature, DefaultToolbars.ButtonId.Signature.Value())
                .AddToolStickyButton(ToolbarButtonType.Undo, DefaultToolbars.ButtonId.Undo.Value())
                .AddToolStickyButton(ToolbarButtonType.Redo, DefaultToolbars.ButtonId.Redo.Value())
                );
        }
Exemplo n.º 10
0
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.viewModel = ViewModelProviders.Of(this)
                      .Get(Java.Lang.Class.FromType(typeof(BarcodeCaptureSettingsViewModel))) as BarcodeCaptureSettingsViewModel;
 }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.viewModel = ViewModelProviders.Of(this)
                      .Get(Java.Lang.Class.FromType(typeof(ScanAreaTopMarginViewModel))) as ScanAreaTopMarginViewModel;
 }
Exemplo n.º 12
0
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.viewModel = ViewModelProviders.Of(this)
                      .Get(Java.Lang.Class.FromType(typeof(LocationRadiusMeasureUnitViewModel))) as LocationRadiusMeasureUnitViewModel;
 }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.viewModel = ViewModelProviders.Of(this)
                      .Get(Java.Lang.Class.FromType(typeof(ViewfinderLaserlineWidthViewModel))) as ViewfinderLaserlineWidthViewModel;
 }
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.viewModel = ViewModelProviders.Of(this).Get(Java.Lang.Class.FromType(typeof(CodeDuplicateFilterSettingsViewModel))) as CodeDuplicateFilterSettingsViewModel;
 }
Exemplo n.º 15
0
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     this.viewModel = ViewModelProviders.Of(this)
                      .Get(Java.Lang.Class.FromType(typeof(PointOfInterestXViewModel))) as PointOfInterestXViewModel;
 }