Dynamically switching icon of docking window

Docking/MDI for WPF Forum

Posted 1 year ago by Yuki
Version: 22.1.5
Avatar

Hello,

I'd like to switch icon of docking window dynamically following changes of title text color of dokcing window.

  • Selecting window / Mouse overed document window  : Title text color is white.
    --> I'd like to use white icon.
  • No selecting window : Title text color is black.

If there is any easy way , would you please tell me it?

[Modified 1 year ago]

Comments (3)

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

Hello,

We do support that kind of thing via our use of DynamicImage and ImageProvider as described in the documentation.  Docking windows do use DynamicImage in their templates but after looking, they don't currently track the text Foreground, so monochrome vector image adaptation will only work on a theme basis in the 22.1 version and not as the Foreground color changes for states.

We have updated it so that monochrome vector image adaptation will work in v23.1 once that is released.  You will be able to use monochrome vector images like this and have them track the current text Foreground properly in that version:

<docking:ToolWindow.ImageSource>
	<DrawingImage 
		xmlns:dynImageIntro="clr-namespace:ActiproSoftware.ProductSamples.SharedSamples.QuickStart.DynamicImageIntro"										
		shared:ImageProvider.Provider="{x:Static dynImageIntro:ImageProviders.ForegroundChanging}">
		<DrawingImage.Drawing>
			<DrawingGroup>
				<GeometryDrawing Brush="#30000000" Geometry="M 0,16 A 16,16 0 1 1 32,16 A 16,16 0 1 1 0,16 Z" />
				<GeometryDrawing Brush="#000000" Geometry="M 5.75,17.25 L 8.75,14.25 L 13,19 L 23.5,8.25 L 26.25,11.25 L 13,24.5 Z" />
			</DrawingGroup>
		</DrawingImage.Drawing>
	</DrawingImage>
</docking:ToolWindow.ImageSource>

Note that this particular DrawingImage is using an ImageProvider example in the Dynamic Image Intro QuickStart.


Actipro Software Support

Posted 1 year ago by Yuki
Avatar

Hello,

Thank you for replying.

Can I get preview build of v23.1?

I'd like to check it before v23.1 will release officially.

  

By the way, when will v23.1 be released?

[Modified 1 year ago]

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

Hello,

v23.1 is very close to complete but we are doing some final updates before it's ready.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.