ということが今の職場でよく起きてそれを調べる用のツールを作ったので公開する。
Missing Reference Finder
https://github.com/yooontheearth/missing-reference-finder

使い方はいたって簡単。Pathにbin等のフォルダを指定してcheckボタンを押下するだけ。指定のフォルダかGACにないものはMISSING扱いになる。

public ObservableCollection<TextData> TextList { get; set; }
TextList = new ObservableCollection<TextData>(
new List<TextData>
{
new TextData{ Left=110, Top=110, Text="嘘だと" },
new TextData{ Left=210, Top=210, Text="言ってよ" },
new TextData{ Left=310, Top=310, Text="バーニィ" },
});
各TextDataクラスはLeft, TopでCanvas上の位置を保持している。<ItemsControl ItemsSource="{Binding Path=TextList}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Text}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemContainerStyle>
<Style>
<Setter Property="Canvas.Top" Value="{Binding Path=Top}" />
<Setter Property="Canvas.Left" Value="{Binding Path=Left}" />
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
ポイントはItemsControl.ItemsPanelのItemsPanelTemplateを使用している箇所。そこでアイテム配置用のパネルにCanvasを指定しているので、下のほうのItemsControl.ItemContainerStyleで各アイテムのLeft, Topを指定して任意の位置にデータを表示させることが可能となる。<Button Command="{Binding ClickCommand}"
Content="Click Me" />
public RelayCommand ClickCommand { get; private set; }
ClickCommand = new RelayCommand(() =>
{
// Do something...
});
<ItemsControl ItemsSource="{Binding DataList}">
<ItemsControol.ItemTemplate>
<DataTemplate>
<Button Command="{Binding DataContext.ClickCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
CommandParameter="{Binding}"
Content="Click Me" />
</DataTemplate>
</ItemsControol.ItemTemplate>
</ItemsControl>
public ObservableCollection<DataItem> DataList { get; set; }
public RelayCommand<DataItem> ClickCommand { get; private set; }
ClickCommand = new RelayCommand(x =>
{
// Do something...
});
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
DataContext="{Binding ViewModel, Source={StaticResource Locator}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<cmd:EventToCommand Command="{Binding WindowLoadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
public RelayCommand WindowLoadedCommand{ get; private set; }
WindowLoadedCommand= new RelayCommand(() =>
{
// Do something...
});
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
DataContext="{Binding ViewModel, Source={StaticResource Locator}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Closing">
<cmd:EventToCommand Command="{Binding WindowClosingCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
public RelayCommand WindowClosingCommand<System.ComponentModel.CancelEventArgs>{ get; private set; }
WindowClosingCommand= new RelayCommand(x =>
{
// Do something...
});
// これだけじゃ駄目
public partial class Keyword : BaseUserControl{ }
// 以下、このブログポストのコードは必要な箇所以外をすべて省略している
public class Entry
{
public ObservableCollection<entrysense> Senses { get; set; }
}
public class EntrySense
{
public ObservableCollection<gloss> Glosses { get; set; }
}
public class Gloss
{
public string Text{ get; set; }
}
public class JMDictModifierPresenter
{
public ObservableCollection<Entry> CurrentEntries { get; set; }
}
<ListBox
ItemsSource="{Binding CurrentEntries}"
IsSynchronizedWithCurrentItem="True" >
<!--省略-->
</ListBox>
<ListBox
ItemsSource="{Binding CurrentEntries.CurrentItem.Senses}"
IsSynchronizedWithCurrentItem="True" >
<!--省略-->
</ListBox>
<ListView ItemsSource="{Binding Path=CurrentEntries.CurrentItem.Senses.CurrentItem.Glosses}" >
<ListView.View>
<!--省略ここから-->
<TextBox Text="{Binding Text}" />
<!--省略ここまで-->
</ListView.View>
</ListView>
public class Entry {
// ---省略---
public override bool Equals(object obj)
{
if (obj is Entry)
return (obj as Entry).Kanji == this.Kanji;
return false;
}
// ---省略---
}