コード例 #1
0
    // ...

    private void AtSomeLaterPoint()
    {
        // open another window and pass the difficulty via its constructor
        var otherWindow = new OtherWindow(_difficulty);

        otherWindow.Show();
    }
コード例 #2
0
    public MainViewModel()
    {
        var otherView = new OtherWindow();

        otherView.Show();
        var downloader = Application.Current.Resources["MyDownloader"] as Downloader;

        downloader.DownloadProgressChanged                       += (sender, args) =>
                                                         Progress = args.ProgressPercentage;
        downloader.Get("http://mirror.internode.on.net/pub/test/10meg.test");
    }
コード例 #3
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            OtherWindow other = new OtherWindow();

            other.Closed += (sender2, e2) =>
            {
                label1.Content = other.SomeData;
            };

            //either of the methods below, depending on desired behavior.
            other.Show();
            //other.ShowDialog();
        }
コード例 #4
0
    public MainViewModel()
    {
        // Open new window beside Main
        var otherView = new OtherWindow();

        otherView.Show();
        // Get downloader resource
        var downloader = Application.Current.Resources["MyDownloader"] as Downloader;

        // Update property when ever download progress changes (event)
        downloader.DownloadProgressChanged                       += (sender, args) =>
                                                         Progress = args.ProgressPercentage;
        // Start downloading a 10Mb file
        downloader.Get("http://mirror.internode.on.net/pub/test/10meg.test");
    }
コード例 #5
0
 private void MainViewModel_OtherStarted(object sender, BankAccountsEventArgs e)
 {
     _otherWindow             = new OtherWindow();
     _otherWindow.DataContext = _mainViewModel;
     _otherWindow.Show();
 }