If you are trying to bind to a particular dictionary element, then you can use a fairly simple trick. First of all, here's a bit of code-behind that we are going to use to bind to.
using System.Collections.Generic;
using System.Windows;
namespace BindingSampleTest
{
public partial class MainWindow : Window
{
public Dictionary<string, OPC> Tag { get; set; }
public MainWindow()
{
InitializeComponent();
Tag = new Dictionary<string, OPC>();
Tag.Add("Test", new OPC { OPCTag = "Hello" });
Tag.Add("Test2", new OPC { OPCTag = "Hello there" });
DataContext = Tag;
}
public class OPC
{
public string OPCTag { get; set; }
}
}
}
Now, let's add the XAML bindy-goodness and rejoice at the gooeyness that is WPF data binding.
<Window x:Class="BindingSampleTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="OPC Window" Height="350" Width="525">
<Grid>
<TextBlock Text="{Binding [Test].OPCTag}" />
</Grid>
</Window>
If you look at the Binding, you can see that the trick is just to use the dot property to access it. I hope this helps.