dos WPF有任何第三方软件或者可以在css和XAML(wpf)之间结合的东西吗?
如果没有,dos有谁知道设计WPF界面的解决方案看起来更像是使用Css / javascript的WebPages?
答案 0 :(得分:2)
该项目看起来很有前途,并且正在积极开发中。
https://github.com/warappa/XamlCSS/wiki/Getting-started
WIKI的例子是
<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:css="clr-namespace:XamlCSS;assembly=XamlCSS"
x:Class="App.App">
<Application.Resources>
<ResourceDictionary>
<css:StyleSheet x:Key="inlineStyle">
<css:StyleSheet.Content>
.important
{
BackgroundColor: Red;
FontSize: 25;
WidthRequest: 200;
}
Label
{
TextColor: Red;
FontSize: 25;
}
Button
{
TextColor: Blue;
BackgroundColor: Black;
}
</css:StyleSheet.Content>
</css:StyleSheet>
</ResourceDictionary>
</Application.Resources>
</Application>
和主页。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:css="clr-namespace:XamlCSS;assembly=XamlCSS"
xmlns:cssXF="clr-namespace:XamlCSS.XamarinForms;assembly=XamlCSS.XamarinForms"
xmlns:local="clr-namespace:App2"
x:Class="App.MainPage">
<StackLayout cssXF:Css.StyleSheet="{StaticResource inlineStyle}">
<Button Text="OK"></Button>
<Button cssXF:Css.Class="important" Text="Important"></Button>
</StackLayout>
</ContentPage>