wpf 设计元素不同,所以它没有见过设计
我打开了一个项目解决方案,其中 xaml & cs 文件位于不同的位置。而且它不显示该 xaml 文件的设计。xaml 文件以标签开头,就像
<abc FrameworkElement.Height="70"FrameworkElement.Width ="81"xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Grid >
<Grid FrameworkElement.Width="78"FrameworkElement.Height ="78"Canvas.Left ="1034.954"Canvas.Top ="538.54">
<Path Shape.Stretch="Fill"Shape.Stroke ="#FF1A65B6"Shape.StrokeEndLineCap ="Flat"Shape.StrokeLineJoin ="Miter"Shape.StrokeMiterLimit ="4"Shape.StrokeStartLineCap ="Flat"Shape.StrokeThickness ="1"FrameworkElement.Margin ="8,8.5,22,22"Path.Data ="M559.5,574.996C559.5,579.692,555.692,583.5,550.996,583.5L521.004,583.5C516.307,583.5,512.5,579.692,512.5,574.996L512.5,545.504C512.5,540.808,516.307,537,521.004,537L550.996,537C555.692,537,559.5,540.808,559.5,545.504L559.5,574.996z">
<Shape.Fill >
<LinearGradientBrush LinearGradientBrush.EndPoint="0.5,0"LinearGradientBrush.StartPoint ="0.5,1">
<GradientStop GradientStop.Color="#FF5E67FF"GradientStop.Offset ="0" />
<GradientStop GradientStop.Color="#FF006697"GradientStop.Offset ="0.14792899787425995" />
<GradientStop GradientStop.Color="#FF1F89FF"GradientStop.Offset ="1" />
</LinearGradientBrush>
</Shape.Fill>
</Path>
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.Margin ="9.334,10.333,23.333,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Height ="18.685"UIElement.Opacity ="0.44999700784683228"Path.Data ="F1M558.667,553.496C558.667,558.192,513.334,558.192,513.334,553.496L513.334,546.837C513.334,542.141,517.142,538.333,521.838,538.333L550.163,538.333C554.859,538.333,558.667,542.141,558.667,546.837z" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.Margin ="33.988,19.63,34.208,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Height ="9.803"Path.Data ="F1M542.891,557.433C545.597,557.433 547.792,555.238 547.792,552.532 547.792,549.825 545.597,547.63 542.891,547.63 540.184,547.63 537.988,549.825 537.988,552.532 537.988,555.238 540.184,557.433 542.891,557.433" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="25.076,29.255,0,35.021"FrameworkElement.Width ="9.804"Path.Data ="F1M538.88,562.156C538.88,559.448 536.686,557.255 533.978,557.255 531.27,557.255 529.076,559.448 529.076,562.156 529.076,562.268 529.085,562.375 529.093,562.483L529.076,562.483 529.076,570.979 538.88,570.979 538.88,562.483 538.863,562.483C538.871,562.375,538.88,562.268,538.88,562.156" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="26.384,21.412,0,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Width ="7.188"FrameworkElement.Height ="7.189"Path.Data ="F1M533.978,556.601C535.962,556.601 537.572,554.992 537.572,553.007 537.572,551.022 535.962,549.412 533.978,549.412 531.993,549.412 530.384,551.022 530.384,553.007 530.384,554.992 531.993,556.601 533.978,556.601" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.Margin ="32.206,30.324,32.426,28.96"Path.Data ="F1M549.574,565.009C549.574,561.316 546.582,558.324 542.891,558.324 539.197,558.324 536.206,561.316 536.206,565.009 536.206,565.159 536.218,565.307 536.229,565.454L536.206,565.454 536.206,577.04 549.574,577.04 549.574,565.454 549.553,565.454C549.562,565.307,549.574,565.159,549.574,565.009" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="18.838,28.72,0,38.05"FrameworkElement.Width ="8.021"Path.Data ="F1M526.849,556.72C524.633,556.72 522.838,558.515 522.838,560.73 522.838,560.82 522.845,560.909 522.852,560.998L522.838,560.998 522.838,567.95 530.859,567.95 530.859,560.998 530.845,560.998C530.852,560.909 530.859,560.82 530.859,560.73 530.859,558.515 529.063,556.72 526.849,556.72" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="19.907,22.304,0,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Width ="5.882"FrameworkElement.Height ="5.882"Path.Data ="F1M526.849,556.186C528.472,556.186 529.789,554.869 529.789,553.245 529.789,551.621 528.472,550.304 526.849,550.304 525.225,550.304 523.907,551.621 523.907,553.245 523.907,554.869 525.225,556.186 526.849,556.186" />
</Grid>
<Button Button.Name="btnMySpaceBook"UIElement.Opacity ="0"FrameworkElement.Cursor ="Hand"Grid.ColumnSpan ="2" />
</Grid>
</abc>
abc 意味着它不是窗口也不是用户控件......
I opened one project solution in which xaml & cs files are at different place.Also it doesn't shows the design of that xaml file.xaml file begin with tag like
<abc FrameworkElement.Height="70"FrameworkElement.Width ="81"xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Grid >
<Grid FrameworkElement.Width="78"FrameworkElement.Height ="78"Canvas.Left ="1034.954"Canvas.Top ="538.54">
<Path Shape.Stretch="Fill"Shape.Stroke ="#FF1A65B6"Shape.StrokeEndLineCap ="Flat"Shape.StrokeLineJoin ="Miter"Shape.StrokeMiterLimit ="4"Shape.StrokeStartLineCap ="Flat"Shape.StrokeThickness ="1"FrameworkElement.Margin ="8,8.5,22,22"Path.Data ="M559.5,574.996C559.5,579.692,555.692,583.5,550.996,583.5L521.004,583.5C516.307,583.5,512.5,579.692,512.5,574.996L512.5,545.504C512.5,540.808,516.307,537,521.004,537L550.996,537C555.692,537,559.5,540.808,559.5,545.504L559.5,574.996z">
<Shape.Fill >
<LinearGradientBrush LinearGradientBrush.EndPoint="0.5,0"LinearGradientBrush.StartPoint ="0.5,1">
<GradientStop GradientStop.Color="#FF5E67FF"GradientStop.Offset ="0" />
<GradientStop GradientStop.Color="#FF006697"GradientStop.Offset ="0.14792899787425995" />
<GradientStop GradientStop.Color="#FF1F89FF"GradientStop.Offset ="1" />
</LinearGradientBrush>
</Shape.Fill>
</Path>
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.Margin ="9.334,10.333,23.333,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Height ="18.685"UIElement.Opacity ="0.44999700784683228"Path.Data ="F1M558.667,553.496C558.667,558.192,513.334,558.192,513.334,553.496L513.334,546.837C513.334,542.141,517.142,538.333,521.838,538.333L550.163,538.333C554.859,538.333,558.667,542.141,558.667,546.837z" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.Margin ="33.988,19.63,34.208,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Height ="9.803"Path.Data ="F1M542.891,557.433C545.597,557.433 547.792,555.238 547.792,552.532 547.792,549.825 545.597,547.63 542.891,547.63 540.184,547.63 537.988,549.825 537.988,552.532 537.988,555.238 540.184,557.433 542.891,557.433" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="25.076,29.255,0,35.021"FrameworkElement.Width ="9.804"Path.Data ="F1M538.88,562.156C538.88,559.448 536.686,557.255 533.978,557.255 531.27,557.255 529.076,559.448 529.076,562.156 529.076,562.268 529.085,562.375 529.093,562.483L529.076,562.483 529.076,570.979 538.88,570.979 538.88,562.483 538.863,562.483C538.871,562.375,538.88,562.268,538.88,562.156" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="26.384,21.412,0,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Width ="7.188"FrameworkElement.Height ="7.189"Path.Data ="F1M533.978,556.601C535.962,556.601 537.572,554.992 537.572,553.007 537.572,551.022 535.962,549.412 533.978,549.412 531.993,549.412 530.384,551.022 530.384,553.007 530.384,554.992 531.993,556.601 533.978,556.601" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.Margin ="32.206,30.324,32.426,28.96"Path.Data ="F1M549.574,565.009C549.574,561.316 546.582,558.324 542.891,558.324 539.197,558.324 536.206,561.316 536.206,565.009 536.206,565.159 536.218,565.307 536.229,565.454L536.206,565.454 536.206,577.04 549.574,577.04 549.574,565.454 549.553,565.454C549.562,565.307,549.574,565.159,549.574,565.009" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="18.838,28.72,0,38.05"FrameworkElement.Width ="8.021"Path.Data ="F1M526.849,556.72C524.633,556.72 522.838,558.515 522.838,560.73 522.838,560.82 522.845,560.909 522.852,560.998L522.838,560.998 522.838,567.95 530.859,567.95 530.859,560.998 530.845,560.998C530.852,560.909 530.859,560.82 530.859,560.73 530.859,558.515 529.063,556.72 526.849,556.72" />
<Path Shape.Fill="#FFFFFFFF"Shape.Stretch ="Fill"FrameworkElement.HorizontalAlignment ="Left"FrameworkElement.Margin ="19.907,22.304,0,0"FrameworkElement.VerticalAlignment ="Top"FrameworkElement.Width ="5.882"FrameworkElement.Height ="5.882"Path.Data ="F1M526.849,556.186C528.472,556.186 529.789,554.869 529.789,553.245 529.789,551.621 528.472,550.304 526.849,550.304 525.225,550.304 523.907,551.621 523.907,553.245 523.907,554.869 525.225,556.186 526.849,556.186" />
</Grid>
<Button Button.Name="btnMySpaceBook"UIElement.Opacity ="0"FrameworkElement.Cursor ="Hand"Grid.ColumnSpan ="2" />
</Grid>
</abc>
what does abc mean its not a window nor user control ....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不能只是
abc
,因为这会产生编译错误。它可以是一个自定义控件(从另一个控件或框架元素派生的控件),前缀为 命名空间 像这样:
命名空间(
local:
)通常定义在文件的顶部,并指向定义控件的程序集。 (从技术上讲,如果您还在MyControl
标记上设置xmlns="your-namespace-uri"
,则可以跳过命名空间前缀,但这会使< ;Grid>
- 其下方的标记非法,除非获得正确的命名空间。)It cannot be just
abc
since that would create a compilation error.What it can be is a custom control (one that derives from another control or frameworkelement) prefixed with a namespace like so:
The namespace (
local:
) is usually defined at the top of the file and points to the assembly that defines the control. (Technically it's possible to skip the namespace prefix if you also setxmlns="your-namespace-uri"
on theMyControl
-tag but that would make the<Grid>
-tag beneath it illegal unless that gets a proper namespace.)