如何将borner显示为attcahed行为 [英] How to display a borner as an attcahed behaviour

查看:120
本文介绍了如何将borner显示为attcahed行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我有以下边框,用于在我申请的某个阶段显示处理信息。

I have the following border which is used to display processing information at certain stage of my application.

我需要在需要显示它的任何窗口或组件中重用该边框:

I need to reuse that border in any windows or component where I need to display it :

<Border Grid.ColumnSpan="5" Grid.RowSpan="4" Background="White" Opacity="0.8"
					HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
					Visibility="{Binding IsPrinting,UpdateSourceTrigger=PropertyChanged,Converter={StaticResource VisibilityConverter}}">
				<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
					<Image Source="..\..\Images\icons\pdfprint.png" Width="100"></Image>
					<ProgressBar Minimum="0" Maximum="100" IsIndeterminate="{Binding IsPrinting,UpdateSourceTrigger=PropertyChanged}" Height="5" Width="300"/>
					<TextBlock Text="{Binding PrintProgressTitle,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource txtSubTitle}" Margin="0,0,0,10" HorizontalAlignment="Center"/>
					<TextBlock x:Name="_printstate" Text="{Binding PrintProgressMessage,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource txtSubTitle}" HorizontalAlignment="Center"/>
				</StackPanel>
			</Border>

将此边框附加为行为的方式是什么,我可以将其附加到我需要的任何组件。

What is the way to attached this border as a behavior where I can attached it to any component where I need it.

任何样本都会有所帮助

问候

哔叽

推荐答案

您好wakefun,

Hi wakefun,

您想为任何组件添加一个边框作为附加行为,我找不到直接执行此操作的方法,但您可以将此边框设为controlTemplate或进行弹出。如果你有更好的方法,请在这里分享。

You want to add one border as attached behavior for any component or windows, I don't find a way to do this directly, but you can make this border as controlTemplate or make a popup. If you have one better way, please share it here.

顺便说一下,如果你已经解决了这个问题,请记得关闭它。

By the way, if you have solved this thread, please remember to close this.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/cccff000-e902-448a-abf7-3f96dabda846/binding-issue-with -nan-as-a-value?forum = wpf#cccff000-e902-448a-abf7-3f96dabda846

感谢您的理解。

最诚挚的问候,

Cherry


这篇关于如何将borner显示为attcahed行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆