Example #1
0
 public StartWindow()
 {
     InitializeComponent();
     ViewModels.MainViewModel _mainViewModel = new ViewModels.MainViewModel();
     _mainViewModel.CurrentWorkWindow = this;
     this.DataContext = _mainViewModel;
 }
        private void OnStartup(object sender, StartupEventArgs e)
        {
            List<CImage> lImages = new List<CImage>()
            {
                new CImage(
                    Directory.GetCurrentDirectory() + @"\images\stalone\сталоне1.jpg",
                    "stalone1"),
                new CImage(
                    Directory.GetCurrentDirectory() + @"\images\stalone\сталоне2.jpg",
                    "stalone2"),
                new CImage(
                    Directory.GetCurrentDirectory() + @"\images\stalone\сталоне3.jpg",
                    "stalone3"),
            };

            CImage image = new CImage(
                    Directory.GetCurrentDirectory() + @"\images\stalone\сталоне0.jpg",
                    "stalone0");

            List<ACFaceRecognition> lFaceRecognition = new List<ACFaceRecognition>()
            {
                new CFisherRecognition( image, lImages ),
                new CLBPHRecognition( image, lImages ),
                new CPCARecognition( image, lImages ),
            };

            MainView view = new MainView(); // создали View
            MainViewModel viewModel = new ViewModels.MainViewModel(lImages, image, lFaceRecognition); // Создали ViewModel
            view.DataContext = viewModel; // положили ViewModel во View в качестве DataContext
            view.Show();
        }
Example #3
0
 private void text_changed(object sender, TextChangedEventArgs e)
 {
     if (e.OldTextValue != null)
     {
         ViewModels.MainViewModel _mvm = ((ViewModels.MainViewModel)BindingContext);
         _mvm.ChangeMoney();
     }
 }
Example #4
0
 public DataManager(ViewModels.MainViewModel mainViewModel)
 {
     ImportantPerson = new Person(this)
     {
         FirstName = "Anders", LastName = "And"
     };
     Mvm = mainViewModel;
 }
Example #5
0
        public Window1()
        {
            InitializeComponent();

            mainViewModel = new ViewModels.MainViewModel(this);

            SetNames();
        }
Example #6
0
 void AssociatedObject_GotFocus(object sender, RoutedEventArgs e)
 {
     ViewModels.MainViewModel mainViewModel = AssociatedObject.DataContext as ViewModels.MainViewModel;
     if (mainViewModel != null)
     {
         mainViewModel.SelectedItem = AssociatedObject.SelectedItem;
     }
 }
Example #7
0
 void AssociatedObject_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
 {
     ViewModels.MainViewModel mainViewModel = AssociatedObject.DataContext as ViewModels.MainViewModel;
     if (mainViewModel != null)
     {
         mainViewModel.SelectedItem = AssociatedObject.SelectedItem;
     }
 }
Example #8
0
 public MainWindow(User user)
 {
     InitializeComponent();
     //Встановка юзера, настройок + створення екземпляру бази
     DataContext       = new ViewModels.MainViewModel();
     CurUser           = user;
     UserLable.Content = CurUser.Username;
 }
Example #9
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ViewModels.MainViewModel
     {
         StreamID = tbxVideoID.Text
     };
 }
Example #10
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ViewModels.BaseViewModel mainVM = new ViewModels.MainViewModel();

            MainWindow mainWin = new MainWindow();

            mainWin.DataContext = mainVM;

            mainWin.Show();
        }
        public MainPage()
        {
            InitializeComponent();

#if !WITH_DI
            //Typically I would do this in xaml
            //Forced to so that I could do Di option in the same project
            BindingContext = new ViewModels.MainViewModel();
#endif
        }
Example #12
0
        public MainPage()
        {
            InitializeComponent();
            BindingContext = new ViewModels.MainViewModel();

            Master = new MasterPage();
            Detail = new TodoList();
            //    Detail = App.GetMainPage();
            App.MasterDetail = this;
        }
        public SourcesDisplayWindow(ViewModels.MainViewModel mainViewModel)
            : base()
        {
            this.DataContext = mainViewModel;

            InitializeComponent();

            vwSources.SetupDisplay();
            vwSources.SetViewSplitBottom();
        }
Example #14
0
        static int Main(string[] args)
        {
            Application application = new Application();

            // Show about info
            application.ShowAboutView();

            ViewModels.MainViewModel mainViewModel = new ViewModels.MainViewModel(application);

            try
            {
                // Read command line args
                CommandLineViewModel _commandLine = new CommandLineViewModel(args);

                if (!_commandLine.IsGenerateMode)
                {
                    throw new InvalidOperationException("Use the \"-generate\" mode at command line.");
                }

                if (!string.IsNullOrEmpty(_commandLine.ProjectPath))
                {
                    // Open the project
                    System.Console.WriteLine(string.Format(FilePackager.Console.Properties.Resources.OpeningProject, _commandLine.ProjectPath));

                    mainViewModel.OpenProject(_commandLine.ProjectPath);
                }
                else
                {
                    // Setup a temporary project from command line
                    Project          project          = new Project();
                    ProjectViewModel projectViewModel = new ProjectViewModel(project);
                    mainViewModel.Project = projectViewModel;

                    _commandLine.SetupProject(projectViewModel);
                }

                // Generate packages
                mainViewModel.Project.BuildAllPackages();
            }
            catch (Exception exception)
            {
                System.Console.Error.WriteLine(exception.Message);
                return(1);
            }

            if (application.MaxSeverityFound == FilePackager.Packaging.Severity.Error)
            {
                return(1);
            }

            return(0);
        }
Example #15
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            List<Company> Companies = new List<Company>()
            {
                new Company(){ Name="Моя компания", Url="vk.com/shmikel", Address="my House", Phones=null, Phones_inline="+7 903 025 6204\n+7 916 263 6838", Links=null, Links_inline=""},
                new Company(){ Name="Моя компания2", Url="vk.com/shmikel", Address="my House", Phones=null, Phones_inline="+7 903 025 6204\n+7 916 263 6838", Links=null, Links_inline=""},
                new Company(){ Name="Моя компания2", Url="vk.com/shmikel", Address="my House", Phones=null, Phones_inline="+7 903 025 6204\n+7 916 263 6838", Links=null, Links_inline=""}
                
            };

            MainView view = new MainView(); // создали View
            MainViewModel viewModel = new ViewModels.MainViewModel(Companies); // Создали ViewModel
            view.DataContext = viewModel; // положили ViewModel во View в качестве DataContext
            view.Show();
            
        }
Example #16
0
        public RollCallView(ViewModels.MainViewModel mainViewModel)
        {
            InitializeComponent();

            DataContext = mainViewModel;

            this.Closed += (s, e) =>
            {
                RollCallService.RollCallActive = false;
            };

            RollCallService.RollCallActive = true;

            lbGood.ItemsSource    = RollCallService.GoodList;
            lbWaiting.ItemsSource = RollCallService.WaitingList;

            RollCallService.DoRestartRollCall();
        }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            //Creamos un nuevo objeto AppModel, que tendrá las propiedades de nuestro modelo
            Models.AppModel CurrentModel = Models.ModelGenerator.getLineaModel();

            //Creamos un nuevo ViewModel para añadirlo a la vista
            ViewModels.MainViewModel CurrentViewModel = new ViewModels.MainViewModel();

            //Establecemos las propiedades de nuestra ViewModel con datos del modelo
            CurrentViewModel.NumeroLinea = CurrentModel.NumeroLinea;
            CurrentViewModel.Operador = CurrentModel.Operador;

            //Especificamos que modelo deberá utilizarse en nuestra vista
            this.DataContext = CurrentViewModel;

            //Especificamos la lista del modelo que se incluirá en la lista que hay en la vista
            this.ListaLLamadas.ItemsSource = CurrentModel.llamadas;
        }
Example #18
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            //Do not activate now.
            //https://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx:
            //"Flicker occurs if you activate the current window (by calling Window.Current.Activate)
            //before the content of the page finishes rendering. You can reduce the likelihood of seeing
            //a flicker by making sure your extended splash screen image has been read before you activate
            //the current window. Additionally, you should use a timer to try to avoid the flicker by
            //making your application wait briefly, 50ms for example, before you activate the current window.
            //Unfortunately, there is no guaranteed way to prevent the flicker because XAML renders content
            //asynchronously and there is no guaranteed way to predict when rendering will be complete."
            mainViewModel = new ViewModels.MainViewModel(CoreApplication.MainView.CoreWindow.Dispatcher);
            mainViewModel.OnInitialized += OnMainViewModelInitialized;
        }
Example #19
0
        private void InitializeUnity(string args)
        {
#if UNITY
#if UNITY_UWP
            ApplicationView.GetForCurrentView().SuppressSystemOverlays = true;
#endif
            appCallbacks.SetAppArguments(args);
            appCallbacks.AddCommandLineArg("-force-d3d11-no-singlethreaded");
#endif // UNITY
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
#if UNITY
            if (rootFrame == null && !appCallbacks.IsInitialized())
#else
            if (rootFrame == null)
#endif
            {
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language          = Windows.Globalization.ApplicationLanguages.Languages[0];
                rootFrame.NavigationFailed += OnNavigationFailed;
                Window.Current.Content      = rootFrame;
            }

            //Do not activate now.
            //https://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx:
            //"Flicker occurs if you activate the current window (by calling Window.Current.Activate)
            //before the content of the page finishes rendering. You can reduce the likelihood of seeing
            //a flicker by making sure your extended splash screen image has been read before you activate
            //the current window. Additionally, you should use a timer to try to avoid the flicker by
            //making your application wait briefly, 50ms for example, before you activate the current window.
            //Unfortunately, there is no guaranteed way to prevent the flicker because XAML renders content
            //asynchronously and there is no guaranteed way to predict when rendering will be complete."
            mainViewModel = new ViewModels.MainViewModel(CoreApplication.MainView.CoreWindow.Dispatcher);
            mainViewModel.OnInitialized += OnMainViewModelInitialized;
        }
Example #20
0
 public MVVM_BoilerPlate.ViewModels.BaseViewModel ViewModel()
 {
     ViewModels.MainViewModel vm= new ViewModels.MainViewModel();
     vm.Name = "Test";
     return vm;
 }
Example #21
0
 public MainWindow()
 {
     DataContext = new ViewModels.MainViewModel(this);
     InitializeComponent();
 }
 public CalendarDialogView(ViewModels.MainViewModel viewModel)
 {
     this.InitializeComponent();
     ViewModel         = viewModel;
     CalendarViewModel = new ViewModels.CalendarViewModel();
 }
Example #23
0
 public MainView(ViewModels.IViewModelBase vmbase)
 {
     InitializeComponent();
     DataContext = new ViewModels.MainViewModel(vmbase);
 }
Example #24
0
        public MainView()
        {
            InitializeComponent();

            BindingContext = new ViewModels.MainViewModel(this.Navigation);
        }
 public MainView()
 {
     InitializeComponent();
     On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);
     BindingContext = new ViewModels.MainViewModel();
 }
Example #26
0
 public UpdateViewCommand(MainViewModel viewModel)
 {
     this.viewModel = viewModel;
 }
        public EditBoardDialogView(ViewModels.MainViewModel viewModel)
        {
            this.InitializeComponent();

            ViewModel = viewModel;
        }
Example #28
0
        internal void InitializeKinect(Canvas bodyCanvas, Image kinectVideoImage, ViewModels.MainViewModel ViewModel)
        {
            this.bodyCanvas = bodyCanvas;
            this.kinectVideoImage = kinectVideoImage;
            this.ViewModel = ViewModel;

            // set IsAvailableChanged event notifier
            this.kinectSensor.IsAvailableChanged += this.Sensor_IsAvailableChanged;

            // get the coordinate mapper
            this.cm = this.kinectSensor.CoordinateMapper;

            // create the colorFrameDescription from the ColorFrameSource using Bgra format
            FrameDescription colorFrameDescription = this.kinectSensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Bgra);

            // create the bitmap to display
            this.colorBitmap = new WriteableBitmap(colorFrameDescription.Width, colorFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);

            // in case we want to show the skeleton later
            CreateBonesList();

            // and by default we'll show the finger tip
            this.ViewModel.ShowFingerTip = true;

            reader = kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Body);
            reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

            this.ViewModel.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                : Properties.Resources.NoSensorStatusText;
        }
 public MainPage()
 {
     InitializeComponent();
     BindingContext = new ViewModels.MainViewModel();
 }
Example #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainWindow"/> class.
 /// </summary>
 /// <param name="dataContext">The data context.</param>
 /// <exception cref="System.ArgumentNullException"><paramref name="dataContext"/></exception>
 public MainWindow(ViewModels.MainViewModel dataContext)
     : this()
 {
     this.DataContext = dataContext ?? throw new ArgumentNullException(nameof(dataContext));
 }
Example #31
0
 public void MainViewModelConstructorTest()
 {
     ViewModels.MainViewModel target = new ViewModels.MainViewModel();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Example #32
0
 public MainWindow()
 {
     InitializeComponent();
     ViewModels.MainViewModel vm = new ViewModels.MainViewModel();
     this.DataContext = vm;
 }
Example #33
0
 public MainView()
 {
     InitializeComponent();
     DataContext = new ViewModels.MainViewModel();
 }
Example #34
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ViewModels.MainViewModel();
     DocViewer.IsScrollViewEnabled = false;
 }
Example #35
0
 public MainView(ViewModels.IViewModelBase vmbase)
 {
     InitializeComponent();
     DataContext = new ViewModels.MainViewModel(vmbase);
 }
 private void Initialize()
 {
     viewModel = ViewModelLocator.MainViewModel;
 }