Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdating wpf parent window after some action on another window
    text
    copied!<p>i have one wpf window called usermanagement and there is a listbox showing all the users, i have one button in usermanagement window called add user and when i click on that new window opens called adduser, in this window there are input fields to add new user, what i need when i save data and this adduser window close then the usermanagement window update the listbox, means users again update (the new added user should show there after adding). at the moment i needed to open the usermanagement window again to see the new added user. Thanks!</p> <p>here is the code below</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Collections; using Model; namespace Views { /// &lt;summary&gt; /// Interaction logic for frmUserManagement.xaml /// &lt;/summary&gt; public partial class frmUserManagement : Window { public frmUserManagement() { InitializeComponent(); } public void window_loaded(object sender, RoutedEventArgs e) { load_users(); } public void load_users() { RST_DBDataContext conn = new RST_DBDataContext(); var users = (from s in conn.TblUsers select s.UserName).ToList(); Login_Names.ItemsSource = users; } private void add_user(object sender, RoutedEventArgs e) { adduser AddUserWindow = new adduser(); AddUserWindow.ShowDialog(); } } } </code></pre> <p>in xaml file there is </p> <pre><code>&lt;Grid&gt; &lt;ListBox Name="Login_Names" HorizontalAlignment="Left" Height="337" Margin="10,47,0,0" Padding="0,0,0,0" VerticalAlignment="Top" Width="156"&gt; &lt;Button Content="Add" HorizontalAlignment="Left" Margin="10,404,0,0" VerticalAlignment="Top" Width="75" Click="add_user"/&gt; &lt;/Grid&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload