Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how close window from buttom inside content template

$
0
0

Hi guys
In the App.xaml have a style for window to define the
title bar and border of all window in my app.

It look like I want, also have a button to close the window
but i dont know how to close the window.

if i make
  <Button Click="Button_Click"  Content="X" >
 
 in the event handler inside App.xaml.cs
 I dont know how get reference to the window
 
 private void Button_Click(object sender, RoutedEventArgs e)
        {
            referencewindow.Close();
        }

 also need to write drag event to move the window.
 is the correct aproach or mus to try with command binding?
 Any body, know how to do it

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>