csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Reactive.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Perspex;
|
|
using Perspex.Controls;
|
|
using Perspex.Media;
|
|
using Perspex.Windows;
|
|
using Perspex.Windows.Media;
|
|
using Perspex.Windows.Threading;
|
|
|
|
namespace TestApplication
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
ServiceLocator.Register<ITextService>(() => new TextService(new SharpDX.DirectWrite.Factory()));
|
|
|
|
Window window = new Window
|
|
{
|
|
Styles = new Styles
|
|
{
|
|
new Style
|
|
{
|
|
Selector = x => x.Select<Button>().Class(":mouseover"),
|
|
Setters = new[]
|
|
{
|
|
new Setter
|
|
{
|
|
Property = Button.BackgroundProperty,
|
|
Value = new SolidColorBrush(0xffff8080),
|
|
}
|
|
},
|
|
}
|
|
},
|
|
Content = new Button
|
|
{
|
|
Content = "Hello World",
|
|
HorizontalAlignment = HorizontalAlignment.Center,
|
|
VerticalAlignment = VerticalAlignment.Center,
|
|
Background = new SolidColorBrush(0xff808080),
|
|
BorderThickness = 2,
|
|
BorderBrush = new SolidColorBrush(0xff000000),
|
|
},
|
|
};
|
|
|
|
window.Show();
|
|
Dispatcher.Run();
|
|
}
|
|
}
|
|
}
|
|
|