Reducing clutter in Bars RecentDocumentControl

Bars for WPF Forum

Posted 1 month ago by Jason Trenouth
Version: 25.1.3
Avatar

Hi,

I'm converting our product from Ribbon to Bars.

I'm currently converting our recent documents view (backstage).

The new RecentDocumentControl has added:

  • Grouping by date
  • Two columns (name and last opened date)
  • Horizontal lines

I can see how to get rid of the first one (grouping) but not how to get rid of the other two (extra date column, column headers, horizontal lines) - at least not via simple properties. Is there any way of doing that?

The reason is that we have two kinds of recent documents and so two lists to display. This puts space at a premium.

I've tried setting "UseLargeSize" to "False" which helps a bit, but leaves the lines and loses the file+location style.

Thanks in advance,

__Jason

[Modified 1 month ago]

Comments (5)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jason,

The legacy Ribbon's recent document control had large and small variant sizes.  The large variant would render the filename and a description under it, with a tooltip that had the full path.  The small variant would just show the filename and had a tooltip with the full path.

In the Bars implementation of a recent document control, there also are large and small variant sizes that align more with current Office apps.  They are not as densely packed as the legacy versions, but generally show similar things.  As you noted the new large variant also offers grouping, and a second column with date information.

Are you effectively looking for properties to turn off the DateTime column in the large variant, and also hide the separator in each item?


Actipro Software Support

Posted 1 month ago by Jason Trenouth
Avatar

Yes, that's exactly it. I would like to remove the following from the large variant:

  1. the headings
  2. the date time column
  3. the separators

Basically bring it closer to how it was in the Ribbon product.

Thanks, in advance,

__Jason

Posted 1 month ago by Jason Trenouth
Avatar

Or failing that, it might be okay to remove the separator lines from the small variant.

We display the recent documents lists in a splash screen and a backstage tab. The former is more constrained for space so it might be argued that we should switch to the new small variant there.

Thanks again.

__Jason

Answer - Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jason,

The simplest thing would be in our Recent Documents QuickStart, add this in the first bars:RecentDocumentControl:

<bars:RecentDocumentControl.ItemContainerStyle>
	<Style TargetType="bars:RecentDocumentItem">
		<Setter Property="Padding" Value="0,3" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="bars:RecentDocumentItem">
					<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
							Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}"  Padding="{TemplateBinding Padding}">
						<ContentPresenter />
					</Border>

					<ControlTemplate.Triggers>
						<Trigger Property="IsKeyboardFocused" Value="True">
							<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ContainerBackgroundMidLowBrushKey}}" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ContainerBackgroundMidLowBrushKey}}" />
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ContainerBackgroundMidBrushKey}}" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ContainerForegroundLowDisabledBrushKey}}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</bars:RecentDocumentControl.ItemContainerStyle>

That template removes the separator and decreases the padding a bit.  Does that work for you?


Actipro Software Support

Posted 1 month ago by Jason Trenouth
Avatar

That looks better thanks. If I have further Bars conversion questions I'll post them as separate threads.

The latest build of this product (v25.1.4) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.