I need to get up to speed with some intermediate things in WPF and I’m building this small application as my learning grounds.
I have a collection of five pictures. Each picture has certain data tied to it: owner, date, size, etc.
I’d like to be able to click that picture and load that information into display in the same window. I do NOT want to load the information in a new opened window.
Any suggestions on what to search for, or even a small verbal walk through of the process?
I’m using a Frame to load the initial five picture, but I don’t know how to capture the click on the main parent window if the click is being registered inside the user control.
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="22" />
<RowDefinition />
</Grid.RowDefinitions>
<Menu Grid.Row="0">
<MenuItem Header="_File" />
<MenuItem Header="_Edit" />
<MenuItem Header="_View" />
<MenuItem Header="_Help" />
</Menu>
<Frame Grid.Row="1" Name="contentFrame" Source="Roster.xaml" />
</Grid>
Then in Roster.xaml:
<UserControl x:Class="OracleOfLegends.Roster"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
//Lots of goodies here.
</UserControl>
You can do pretty much the same thing in WPF using a
Framewhich you can navigate to a newUserControlcontaining the information.