ModernTab Image

Aug 22, 2014 at 3:58 PM
I am trying to add images in the links of my moderntab

ModernTab.xaml
 <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" Height="*">
                                        <Image Source="{Binding ImageSource}" Width="32" Height="32" />
                                        <TextBlock Text="{Binding DisplayName, Converter={StaticResource ToUpperConverter}}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
Link.cs
private ImageSource imagesource;

...

public ImageSource ImageSource
        {
            get { return this.imagesource; }
            set
            {
                if (this.imagesource != value)
                {
                    this.imagesource = value;
                    OnPropertyChanged("ImageSource");
                }
            }
        }
Example.xaml
<mui:ModernTab Layout="List" SelectedSource="Views/Movimento/ucCaixa.xaml"  FontSize="15">
            <mui:ModernTab.Links>
                <mui:Link DisplayName="Caixa" Source="Views/Movimento/ucCaixa.xaml" ImageSource="pack://application:,,,/Images/search32px.png"  />
                <mui:Link DisplayName="Contas a pagar" Source="Views/Movimento/ucContaPagar.xaml" ImageSource="pack://application:,,,/Images/search32px.png" />
                <mui:Link DisplayName="Conta de cliente" Source="Views/Movimento/ContaCliente2/ucContaCliente.xaml" ImageSource="pack://application:,,,/Images/search32px.png" />
                <mui:Link DisplayName="Vendas" Source="Views/Movimento/Vendas/ucVendasLancamento.xaml" ImageSource="pack://application:,,,/Images/search32px.png" />
            </mui:ModernTab.Links>
        </mui:ModernTab>
But the image does not appear.

Image

Thank outset
I await answers
Coordinator
Aug 22, 2014 at 4:08 PM
Looks good to me. Couple of things to check;
  • Did you modify the ListBox template in the trigger that sets the Layout to list (<Trigger Property="Layout" Value="List">)
  • Do you reference your updated ModernTab style in your app.xaml?
Marked as answer by danilomilan on 8/22/2014 at 9:35 AM
Aug 22, 2014 at 4:24 PM
in app.xaml is as follows, I am referring only ModernUI, but the ImageSource property is already appearing to be informed, just is not showing the image
<ResourceDictionary>
            <!-- WPF 4.0 workaround -->
            <Style TargetType="{x:Type Rectangle}" />
            <!-- end of workaround -->
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml" />
                <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.Light.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
Aug 22, 2014 at 4:34 PM
worked, sorry, but ModerTab was wrong in changing code