title: C# WPF window - internet explorer
body: <p>I need help from someone who work in C#. I'm trying to achieve WPF application that open internet explorer on URL that i supplement him as a parameter. So in perfect world i would like run something like this:</p>
  
  <pre><code> \\path\window.exe X x Y "URL" "Title" 
  </code></pre>
  
  <p>Where X,Y is windows height and width, URL and Title is a title of that window. My knowledge of C# is nonexistent so after extensive use of google i manage to get this XAML:</p>
  
  <pre><code>&lt;Window x:Class="WPFWebControl.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="My Web Browser" WindowState="Normal" Loaded="Window_Loaded" WindowStyle="ThreeDBorderWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="Auto" Width="Auto"&gt;
      &lt;Grid&gt;
          &lt;WebBrowser Height="Auto" HorizontalAlignment="Left" Margin="0,28,0,0" Name="MyWebBrowser" VerticalAlignment="Top" Width="Auto" LoadCompleted="MyWebBrowser_LoadCompleted" /&gt;
          &lt;TextBox Height="23" Margin="40,5,0,0" Name="MyTextBox" VerticalAlignment="Top" HorizontalAlignment="Left" Width="708" /&gt;
          &lt;Button Content="Go" Margin="10,5,0,476" Name="MyGo" ToolTip="Go" Click="MyGo_Click" RenderTransformOrigin="-0.76,0.565" HorizontalAlignment="Left" Width="25" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>and this C# code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  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 WPFWebControl
  {    /// &lt;summary&gt;
       /// Interaction logic for MainWindow.xaml
       /// &lt;/summary&gt;
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
          }
  
          private void Window_Loaded(object sender, RoutedEventArgs e)
          {
              try
              {
                  MyWebBrowser.Source = new Uri("http://www.google.com");
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
              }
          }
  
          private void MyGo_Click(object sender, RoutedEventArgs e)
          {
              try
              {
                  MyWebBrowser.Source = new Uri("http://" + MyTextBox.Text);
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
              }
          }
          private void MyWebBrowser_LoadCompleted(object sender, NavigationEventArgs e)
          {}
      }
  }
  </code></pre>
  
  <p>Now i need some advice how can i set window size, url and title via parameters so i can get rid of that address textbox and button.</p>