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

  • Home
  • SEARCH
  • 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 7788931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:08:05+00:00 2026-06-01T21:08:05+00:00

I am trying to create a simple program that will allow the user to

  • 0

I am trying to create a simple program that will allow the user to Select files and add metadata to it.

I have created a ListBox that allows users to drag and drop files onto it. I grab the path and save it off into an object. I then display the file name in the ListBox.

I want it so that when a User selects an item in the list box I can show the metadata I have on the file and allow them to add more and edit what is there.

Right now I have a Class Item that stores the Path and a dictionary of <string, string> Where the Key is the name of the metadata and the Value is well the value.

I have tried using a DataGrid, and maybe that is the wrong control to use, to bind to the Dictionary. That doesn’t seem to be the right way to do it as it doesn’t implement the INotifyPropertyChanged Interface.

I could create my own class and manually update the DataGrid but it seems like that is a work around to me not knowing how to DataBind correctly.

XAML

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="MetadataAdder.MainWindow"
    Title="Metadata Adder" Height="480" Width="640">
<Grid>
    <Button x:Name="Add_BTN" Content="Add" HorizontalAlignment="Left" Margin="10,410,0,0" VerticalAlignment="Top" Width="50" Click="Add_Click"/>
    <Button x:Name="Remove_BTN" Content="Remove" HorizontalAlignment="Left" Margin="241,410,0,0" VerticalAlignment="Top" Width="50" Click="Remove_Click"/>
    <ListBox x:Name="File_List" HorizontalAlignment="Left" Height="364" Margin="10,31,0,0" VerticalAlignment="Top" Width="281" AllowDrop="True" Drop="FilesDropped" ItemsSource="{Binding Item_List}" SelectionChanged="Item_Selected"/>
    <DataGrid 
        x:Name="MetadataGrid" 
        HorizontalAlignment="Left" 
        Margin="311,31,0,0" 
        VerticalAlignment="Top" 
        Height="364" 
        Width="303" 
        d:LayoutOverrides="GridBox"
        CanUserAddRows="False"
        CanUserDeleteRows="False"
        CanUserReorderColumns="True"
        CanUserResizeColumns="True"
        CanUserResizeRows="True"
        CanUserSortColumns="True"
        />
    <Label Content="Files to add Metadata to" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
    <Label Content="Metadata" HorizontalAlignment="Left" Margin="313,5,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.474,0.115"/>

</Grid>

  • 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-06-01T21:08:08+00:00Added an answer on June 1, 2026 at 9:08 pm

    Another approach that would work well for you would be to create a FileMetadata object of your own that implements INotifiyPropertyChanged and contains properties for the metadata’s Key and Value.

    Then storing your collection of FileMetadata objects in an ObservableCollection and binding to your DataGrid.

    This would allow the individual metadata items to persist their values to the change notification system as well as allow the DataGrid to automatically update if any metadata items are added or removed.

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

Sidebar

Related Questions

i'm trying to create a simple program that will upload a few files for
I am trying to create a program that will do some simple calculations, but
I'm trying to create a simple program or function that will take the users
I have been trying to create a simple program with Python which uses OpenCV
I'm trying to write a simple program that will receive a string of max
I am trying to create a script that will run a program on each
I am trying to create a program that will open a text file with
I have a simple OpenGL program and trying to draw an instanced array that
I am trying to create a simple phonebook program that reads data from a
I am trying to write a simple VBS script that will create folders on

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.