I am using Visual Studio 2015 RC (WPF application C#) and I want my program to open any of my apps (with the click of a button) into my app window, the code below is unfinished.
The problem happens only when I click the button, notepad opens randomly in it's own window, and not in my app's canvas.
Main.Window.xaml:
<Window x:Class="stackoverflowquestion1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:stackoverflowquestion1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Menu x:Name="menu" HorizontalAlignment="Left" Height="22" Margin="2,10,0,0" VerticalAlignment="Top" Width="497" Grid.Column="1">
<Button x:Name="button" Click="button_Click" Width="187">Click here to open Notepad Below</Button>
</Menu>
<Canvas Grid.ColumnSpan="2" HorizontalAlignment="Left" Height="257" Margin="10,52,0,0" VerticalAlignment="Top" Width="489" Background="Black"/>
</Grid></Window>
MainWindow.xaml.cs:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace stackoverflowquestion1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{
Process.Start("notepad.exe");
}
}
}