using System; using System.Windows; using System.Windows.Media; // For Brushes namespace WpfBaseApp1 { /// /// Interaction logic for MainWindow.xaml /// // public partial class MainWindow : Window /* { public MainWindow() { InitializeComponent(); } } */ public class Start_Up { [STAThread()] static void Main() { Application app = new Application(); MainWindow window = new MainWindow(); Start_Up st = new Start_Up(); window.Height = 300; window.Width = 300; window.Background = Brushes.Bisque; // capaple of receiving resources from other class mySource mys = new mySource(); window.Title = "I am on my Own" + mys.str1 ; app.MainWindow = window; /* * // window show will fire up and shut * // Run command will keep window alive * // Nested window too needs app.Run() window.Show(); //app.Run(window); */ window.Show(); st.method1(); app.Run(window); } private void method1() { MessageBox.Show("hello: from private method "); } } public class mySource { public string str1 = " From source" ; public void method1() { MessageBox.Show("hello: from mysource public method "); } } }