I have 2 classes .First class contains all the ui elements and the second one has a slider control to increse the lenght and the width of the first ui ( a canvas )
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Window2 win = new Window2(this); // Name of the animation control window win.Show(); }
its xaml is
<Canvas Background="#FF6F6F6F" Name="grid1" ></Canvas>
The second class is
Can someone point out the error?public partial class Window2 : Window { double zoomf; MainWindow m1; public Window2( MainWindow main) { InitializeComponent(); zoomf = 1.0; m1 = main; timer_start(); } private void Slider_ValueChanged_1(object sender, RoutedPropertyChangedEventArgs<double> e) { double val= sl1.Value; zoomf = val; m1.grid1.Height = 700 * zoomf
m1.grid1.Width = 816 *zoomf;
// Throws the null referece exception at this line
} }
arka Bhattacharya