예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                Stream      stream = File.Open("Background.jpg", FileMode.Open);
                BitmapImage imgsrc = new BitmapImage();
                imgsrc.BeginInit();
                imgsrc.StreamSource = stream;
                imgsrc.EndInit();

                imgBackground.Source = imgsrc;
            }
            catch (IOException) { }

            _viewModel = TryFindResource(ViewModelProviderKey) as SpinnerViewModel;
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                Stream stream = File.Open("Background.jpg", FileMode.Open);
                BitmapImage imgsrc = new BitmapImage();
                imgsrc.BeginInit();
                imgsrc.StreamSource = stream;
                imgsrc.EndInit();

                imgBackground.Source = imgsrc;
            }
            catch (IOException) { }

            _viewModel = TryFindResource(ViewModelProviderKey) as SpinnerViewModel;
        }