So, I been creating some WPF windows using the C# Script Component, I’m been using a class, but I can’t figure out how to expire the component solution, with in one of events of the class,
I have seen the @DavidRutten TrackBar Example:https://discourse.mcneel.com/t/windows-forms-track-bar-live-update-to-grasshopper-component/36731/2?u=antonio_cersosimo
public MyWindow wdw;
public static string fileName;
public class MyWindow : Window{
public MyWindow()
{
LoadXAMLMethod();
this.WindowStyle = System.Windows.WindowStyle.None;
this.AllowsTransparency = true;
this.Topmost = true;
}
System.Windows.Controls.Button ButtoninXAML;
public void LoadXAMLMethod()
{
StreamReader mysr = new StreamReader(fileName);
DependencyObject rootObject = System.Windows.Markup.XamlReader.Load(mysr.BaseStream) as DependencyObject;
ButtoninXAML = LogicalTreeHelper.FindLogicalNode(rootObject, "button1") as System.Windows.Controls.Button;
ButtoninXAML.Click += new RoutedEventHandler(Button_Click);
this.Content = rootObject;
}
public void Button_Click(object sender, RoutedEventArgs e)
{
System.Windows.MessageBox.Show("Hi WPF");
Component.ExpireSolution(true);///////////////////////////
}
}
So, I need to be able to expire the solution with in the Button_Click Event, to update the output of the component,So Any ideas?? Thanks