//====================================================================== // Button Click Functions //====================================================================== // When house button is clicked private void HouseButton_Click(object sender, RoutedEventArgs e) { SetButtonMode(HOUSE_BUTTON); // Set house flag and house type ElementMenuItem button = (ElementMenuItem)sender; houseType = button.Name; }
private void ElementShareRight_click(object sender, RoutedEventArgs e) { ElementMenuItem check = (ElementMenuItem)sender; ScatterViewItem svi = new ScatterViewItem(); String Aloha = check.Uid; Grid addition = new Grid(); addition.Children.Add(WindowCall(Aloha)); svi.Content = addition; //Sets the new grid as the SVI content SVR.Items.Add(svi); ElementMenu menu = new ElementMenu(); menu.ActivationHost = svi; menu.ActivationMode = ElementMenuActivationMode.HostInteraction; ElementMenuItem emi = new ElementMenuItem(); emi.Header = "Close"; emi.Click += new RoutedEventHandler(ElementCloseMenuItem_Click); menu.Items.Add(emi); ElementMenuItem emi2 = new ElementMenuItem(); emi2.Header = "Share"; emi2.Click += new RoutedEventHandler(ElementShareLeft_click); emi2.Uid = Aloha; emi.Icon = WindowCall(Aloha); //Will have to change to seperate image when WindowCall changed to browser menu.Items.Add(emi2); menu.VerticalAlignment = System.Windows.VerticalAlignment.Top; menu.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; addition.Children.Add(menu); //adds ElementMenu to the grid }
//Browser Code private void BuildBrowserInScatterView(string s, ScatterView scatterview) { ScatterViewItem svi = new ScatterViewItem(); Grid addition = new Grid(); CustomBrowser webBrower = new CustomBrowser(); webBrower.scatter = scatterview; webBrower.Width = double.NaN; //set it for auto width webBrower.Height = double.NaN; webBrower.Source = new Uri(s); webBrower.ShowCreatedWebView += new ShowCreatedWebViewEventHandler(webBrower_ShowCreatedWebView); //newItem.Margin = new Thickness(25.0, 25.0, 25.0, 25.0); svi.Padding = new Thickness(25.0, 25.0, 25.0, 25.0); //newItem.Content = webBrower; WrapPanel wrap = new WrapPanel(); wrap.Orientation = System.Windows.Controls.Orientation.Vertical; //wrap.Children.Add(new SurfaceTextBox()); wrap.Children.Add(webBrower); addition.Children.Add(wrap); svi.Content = addition; //Sets the new grid as the SVI content //ElementMenuItem check = (ElementMenuItem)sender; scatterview.Items.Add(svi); ElementMenu menu = new ElementMenu(); menu.ActivationHost = svi; menu.ActivationMode = ElementMenuActivationMode.HostInteraction; ElementMenuItem emi = new ElementMenuItem(); emi.Header = "Close"; emi.Click += new RoutedEventHandler(ElementCloseMenuItem_Click); menu.Items.Add(emi); menu.VerticalAlignment = System.Windows.VerticalAlignment.Top; menu.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; addition.Children.Add(menu); //adds ElementMenu to the grid }
private void ElementMenuRight_click(object sender, RoutedEventArgs e) { ScatterViewItem svi = new ScatterViewItem(); Grid addition = new Grid(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "JPEG Files (*.jpg)|*.jpg"; openFileDialog1.Title = "Select an Image File"; //List<string> RightValues = new List<string>(); // Show the Dialog. // If the user clicked OK in the dialog and // a .JPG file was selected, open it. if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //RightValues.Add(openFileDialog1.FileName); addition.Children.Add(WindowCall(openFileDialog1.FileName)); svi.Content = addition; //Sets the new grid as the SVI content ElementMenuItem check = (ElementMenuItem)sender; SVR.Items.Add(svi); ElementMenu menu = new ElementMenu(); menu.ActivationHost = svi; menu.ActivationMode = ElementMenuActivationMode.HostInteraction; ElementMenuItem emi = new ElementMenuItem(); emi.Header = "Close"; emi.Click += new RoutedEventHandler(ElementCloseMenuItem_Click); menu.Items.Add(emi); ElementMenuItem emi2 = new ElementMenuItem(); emi2.Header = "Share"; emi.Icon = WindowCall(openFileDialog1.FileName); //Will have to change to seperate image when WindowCall changed to browser emi2.Click += new RoutedEventHandler(ElementShareLeft_click); emi2.Uid = openFileDialog1.FileName; menu.Items.Add(emi2); menu.VerticalAlignment = System.Windows.VerticalAlignment.Top; menu.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; addition.Children.Add(menu); //adds ElementMenu to the grid } }