Posted 16 years ago
by LaurentB
-
Intersystems
Helo,
I want to create a RibbonGallery that contains Labels. I can display it fine, but if I open the list and then close, the labels desappear. Where are they ?
This is the XAML of my Window :using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ActiproSoftware.Windows.Controls.Ribbon.Controls;
namespace WpfApplication4
{
/// <summary>
/// Interaction logic for RibbonWindow1.xaml.
/// </summary>
public partial class RibbonWindow1 : ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow
{
public RibbonWindow1()
{
InitializeComponent();
}
}
}Many thanks
I want to create a RibbonGallery that contains Labels. I can display it fine, but if I open the list and then close, the labels desappear. Where are they ?
This is the XAML of my Window :
<ribbon:RibbonWindow x:Class="WpfApplication4.RibbonWindow1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
ApplicationName="RibbonWindow1" Width="620" Height="420">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid/>
<ribbon:Ribbon x:Name="ribbon" Grid.Row="0">
<ribbon:Ribbon.Tabs>
<ribbon:Tab Label="Home" KeyTipAccessText="H">
<ribbon:Group Label="New Group">
<ribbon:RibbonGallery IsSelectionHighlightVisible="False">
<ribbon:RibbonGallery.ItemsSource>
<x:Array Type="{x:Type Label}">
<Label Content="sss1"/>
<Label Content="sss2"/>
<Label Content="sss3"/>
<Label Content="sss4"/>
<Label Content="sss5"/>
<Label Content="sss6"/>
<Label Content="sss7"/>
<Label Content="sss8"/>
<Label Content="sss9"/>
<Label Content="sss10"/>
</x:Array>
</ribbon:RibbonGallery.ItemsSource>
<ribbon:RibbonGallery.ItemTemplate>
<DataTemplate>
<Label Content="{Binding BindsDirectlyToSource=True}" />
</DataTemplate>
</ribbon:RibbonGallery.ItemTemplate>
<ribbon:RibbonGallery.PopupContent>
<StackPanel>
<ribbon:PopupGallery InitialColumnCount="4" IsSelectionHighlightVisible="False"
ItemTemplate="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ribbon:RibbonGallery}}, Path=ItemTemplate, Mode=Default}"
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ribbon:RibbonGallery}}, Path=ItemsSource, Mode=Default}"
/>
</StackPanel>
</ribbon:RibbonGallery.PopupContent>
</ribbon:RibbonGallery>
</ribbon:Group>
</ribbon:Tab>
</ribbon:Ribbon.Tabs>
</ribbon:Ribbon>
</Grid>
</ribbon:RibbonWindow>
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ActiproSoftware.Windows.Controls.Ribbon.Controls;
namespace WpfApplication4
{
/// <summary>
/// Interaction logic for RibbonWindow1.xaml.
/// </summary>
public partial class RibbonWindow1 : ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow
{
public RibbonWindow1()
{
InitializeComponent();
}
}
}