Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6956877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:55:35+00:00 2026-05-27T14:55:35+00:00

I’m a complete beginner in WPF so this is probably very simple. The following

  • 0

I’m a complete beginner in WPF so this is probably very simple.

The following application is to launch arbitrary processes from data in a grid.

The part I am currently unsure about is how to effect the change to a Row instance that is passed into an auto-wired event handler, specifically Browse(Row row) in the model below:

XAML:

<Window x:Class="LauncherApp.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cm="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <TextBlock x:Name="Title" />
        <DataGrid AutoGenerateColumns="False" Name="dataGrid1" ItemsSource="{Binding Source}">
            <DataGrid.Columns>
                <DataGridTemplateColumn>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Content="Run" cm:Message.Attach="Run($dataContext)" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Folder">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <WrapPanel>
                                <TextBox Text="{Binding Folder}" x:Name="Folder" />
                                <Button Content="Browse" cm:Message.Attach="Browse($dataContext)" />
                            </WrapPanel>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding Command}" Header="Command"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>

Model:

namespace LauncherApp.ViewModels
{
    using Caliburn.Micro;
    using System.Collections.ObjectModel;
    using System.Windows;
    using System.Diagnostics;

    public class ShellViewModel : PropertyChangedBase
    {
        private string title;
        public string Title
        {
            get { return title; }
            set
            {
                if (title != value)
                {
                    title = value;
                    RaisePropertyChangedEventImmediately("Title");
                }
            }
        }

        public ShellViewModel()
        {
            Title = "Hello Caliburn.Micro";
            Source = new ObservableCollection<Row>(
                new[]
                {
                    new Row {},
                    new Row {},
                }
            );
        }

        public void Run(Row row)
        {
            Process process = new Process();
            process.StartInfo.FileName = row.Folder + row.Executable;
            process.StartInfo.Arguments = row.Arguments;
            process.Start();
        }

        public void Browse(Row row)
        {
            var dialog = new System.Windows.Forms.FolderBrowserDialog();
            System.Windows.Forms.DialogResult result = dialog.ShowDialog();
            string path = dialog.SelectedPath;

            row.Folder = path; // <-- THIS CHANGE DOES NOT MAKE IT BACK TO THE UI

        }

        public ObservableCollection<Row> Source { get; set; }
    }

    public class Row
    {
        public string Folder { get; set; }
        public string Executable { get; set; }
        public string Arguments { get; set; }
    }
}

UPDATE: Here’s the changes I made to make it work (thanks to EisenbergEffect)

Row class inherits PropertyChangeBase

public class Row : PropertyChangedBase // <-- add
{
    public string Folder { get; set; }
    public string Executable { get; set; }
    public string Arguments { get; set; }
}

Change notification after update

    public void Browse(Row row)
    {
        var dialog = new System.Windows.Forms.FolderBrowserDialog();
        System.Windows.Forms.DialogResult result = dialog.ShowDialog();
        string path = dialog.SelectedPath;
        row.Folder = path;
        row.RaisePropertyChangedEventImmediately("Folder"); // <-- add
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:55:36+00:00Added an answer on May 27, 2026 at 2:55 pm

    You need to implement INotifyPropertyChanged on Row (or inherit from Caliburn.Micro’s PropertyChangeBase) and make sure to raise the appropriate event in the property setter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.