c# - How can I tell when a visible change occurrs in a WPF Window? -


I'm capturing a visual representation of a WPF window with arbitrary content (control, etc.). When changing the window visually, I need to capture a picture of the window.

When visually in the window (the shape changed, the material changed), then what can I tell her to tell her)? I do not care about any other changes.

I know that when the rendering is finished, some questions related to it are received, but I am not sure that since I am more worried about the window, one area, and I am about the render I am not worried if none of the scenes is changed.

You can use the event, you should do what you need.
Consider the following:

  & lt; Window x: Class = "WpfApplication11.MainWindow" xmlns = "http://schemas.microsoft.com/comfx / 2006 / xaml / Presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/ Xaml "title =" main window "height =" 350 "width =" 525 "layout update =" MainWindow_OnLayoutUpdated "& gt; & Lt; StackPanel & gt; & Lt; Label & gt; Last Event: & lt; / Labels & gt; & Lt; Text Box X: Name = "Last Document" /> & Lt; Label x: name = "updateable" & gt; Updateable & lt; / Labels & gt; & Lt; Uniform Grid x: Name = "Control" /> & Lt; / StackPanel & gt; & Lt; / Window & gt;   

and the code behind it:

  public partial square main window {public main window} {starting object (); Link to the button (empty, empty); Var timer = new timer (1000); Timer Elapsed + = timer_Elapsed; Timer.start (); } Private Zero timer_albsed (Object Sender, ElapsedEventArgs e) {Dispatcher.Invoke (New Action ((=) => {var rand = new Random (); can be updated • Background = New SolidColorBrush (Color.FromRgb (( Byte) rand.Next (byte.maxview), (byte) rand.ext (byte.maxview), (byte) rand. Next (byte maxwellell)));})); } Private Zero Button (Object Sender, Routing Avenger ARG E) {var button = new button {content = "click me!"}; button. Click + = Click the button; Controls.Children.Add (button); } Private Zero MainWindow_OnLayoutUpdated (Object Sender, EventArgs eventArgs) {LastEvent.Text = DateTime.Now.ToLongTimeString (); }}    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -