在wpf中更改运行时的路径控制 [英] Change path control at run time in wpf

查看:192
本文介绍了在wpf中更改运行时的路径控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要在运行时更改路径控制数据

need to change path control data at runtime

推荐答案

您可以在运行时自由更改形状大小以及其他任何属性。它还适用于与其他UI元素协作的附加属性,例如location, Grid.Row Grid.Column (仅举例)。



此外,请理解没有任何内容可以不实时更改。无论你在XAML中做什么,都会在运行时重现。 XAML用于自动生成一些代码(您可以在项目目录的子目录下找到自动生成的文件,obj);并且这段代码总是在运行时执行。



顺便说一句,它为您提供了一些学习如何在运行时修改一些UI元素的技巧。以下是这个想法:首先,为了研究目的,创建一些项目并在XAML中定义所需的行为或UI设置。编译项目。然后在项目目录的子目录obj中找到自动生成的代码文件,看看它们的作用。它将为您提供如何在您自己的代码中更改UI的一个或另一个功能的确切想法。这种方法非常简单,几乎总是有效。



-SA
You can freely change shape size, as well as any other of its properties at run time. It also goes for attached properties which collaborates with other UI elements, such as location, Grid.Row, Grid.Column (just for example).

Also, please understand that there is nothing which would be changed "not in real time". No matter you do in XAML, it is reproduced during run time. XAML is used to auto-generate some code (you can find the auto-generated files under the sub-directory of the project directory, "obj"); and this code is executed during run time, always.

By the way, it gives you some technique of learning how to modify some UI elements during run time. Here is the idea: first, for the research purpose, create some project and define the desired behavior or UI setup in XAML. Compile the project. Then locate auto-generated code files in the sub-directory "obj" of the project directory and see what they do. It will give you the exact idea how to change one or another feature of the UI in your own code. This approach is very simple and nearly always works.

—SA


这篇关于在wpf中更改运行时的路径控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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