avaloniaui / avalonia Goto Github PK
View Code? Open in Web Editor NEWDevelop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
Home Page: https://avaloniaui.net
License: MIT License
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
Home Page: https://avaloniaui.net
License: MIT License
Load a listbox that has scrollbars, select the first item and press down arrow. Doesn't scroll to show selected item.
Instead of Control.
This will be identical to WPF I imagine.
The following code:
new Grid
{
ColumnDefinitions = new ColumnDefinitions
{
new ColumnDefinition(GridLength.Auto),
new ColumnDefinition(new GridLength(4, GridUnitType.Pixel)),
new ColumnDefinition(GridLength.Auto),
},
RowDefinitions = new RowDefinitions
{
new RowDefinition(GridLength.Auto),
new RowDefinition(new GridLength(4, GridUnitType.Pixel)),
new RowDefinition(GridLength.Auto),
new RowDefinition(new GridLength(4, GridUnitType.Pixel)),
new RowDefinition(GridLength.Auto),
new RowDefinition(new GridLength(4, GridUnitType.Pixel)),
new RowDefinition(GridLength.Auto),
},
Children = new Controls
{
new TextBlock
{
Text = "Log In",
FontSize = 24,
HorizontalAlignment = HorizontalAlignment.Center,
[Grid.ColumnSpanProperty] = 3,
},
new TextBlock
{
Text = "Username",
VerticalAlignment = VerticalAlignment.Center,
[Grid.RowProperty] = 2,
},
new TextBox
{
MinWidth = 120,
[Grid.ColumnProperty] = 2,
[Grid.RowProperty] = 2,
},
new TextBlock
{
Text = "Password",
VerticalAlignment = VerticalAlignment.Center,
[Grid.RowProperty] = 4,
},
new TextBox
{
MinWidth = 120,
[Grid.ColumnProperty] = 2,
[Grid.RowProperty] = 4,
},
},
};
Produces this:
The central column should be 4 pixels, but it's being stretched by the first row's Grid.ColumnSpan
property. Grid
was ported from Moonlight so I have no idea why it's not working.
At the moment if you create a window with a small TextBlock the window can't resize itself small enough to fit to content and a black portion of background is shown.
This is related to #24.
Would be possible to bind to INotifyPropertyChanged or use libraries like Mvvm cross?
Wpf has DataContext like concept, how we can bind to external models?
Any sample?
Here is a link on how to bind to an instance of INotifyPropertyChanged:
Thanks,
Amer
If a lazily-evaluated IEnumerable is assigned to ItemsControl.Items
then stuff breaks, as the sequence gets re-enumerated every time the control accesses the items.
Some possible solutions:
Items
and ItemsSource
. This feels a little messy to me, having two properties to do essentially the same thing, and making one read-only in certain situations etc as in WPF.Items
from IEnumerable
to ICollection
.ICollection
or IList
etc.@SuperJMN thoughts? Any other ideas?
Load a listbox that needs scrollbars. Scroll to bottom and try to select item - doesn't work.
As title say, use GTK3 instead of GTK2, MonoDevelop started using GTK3 along with Mono Xwt.
I am using a 4k Monitor with dpi around 132 and the example program looks uncool, since it is scaled up.
I had a succesful try to make User32 know Perspex is DPI aware and I get it to display 1:1 (unscaled). Of course quite smallish, then.
My Idea now is to change the Window and Popup-Style to have the RenderTransform > 1.0
But how shall this be communicated through the layers. Maybe just inside the Win32Platform as a static used when Windows are opened (they also have to be larger). But the themes are elsewhere.
So what is the consensus about a global ScaleFactor-DP for the Themes?
Maybe the title can be missleading but there is an issue with template create when having something like this:
var window = new Window()
{
Content = new ContentControl
{
Content = new TreeView
{
Items = treeData
}
}
}
The implementation is very naive at the moment, and also not very good. My current thoughts on this:
As can be seen in TestApplication.
I would like to embed my DirectX11 rendering widget inside the application, in WPF is done using D3DImage or WindowsForms host using interop, how would this be possible here?
Same logic goes on GTK with OpenGL.
Being that this is a new stack, it would be great is if was designed with IoC in mind from the get go.
This means ideally then runtime and all its components can be constructed via a container. Custom user components like controls could have dependencies injected as well, all via ctor injection.
I would recommend looking to Fubu MVC and also ASP.NET MVC/Web API for inspiration.
PerspexObject should respect implicit casting when setting values.
The :pointerover style is not being removed from an element when the mouse leaves the Window without first intersecting another element.
Cannot find license.md which should contain the MIT license stuff.
Would be better if possible to avoid different licenses that the one that Perspex uses, PriorityQueue probably can be replaced with Queue from .NET.
Here is something similar:
http://codereview.stackexchange.com/questions/38560/priorityqueuet-implementation
Would it be possible to use also OpenGL as a rendering subsystem?
Which requirements are necessary for the rendering subsystem?
Add a unit test for this.
The enum doesn't match WPF equivalent enum ("Centered" is "Center")
public enum TextAlignment
{
Left,
Centered,
Right,
}
Doesn't seem to matter whether it's null or "".
In PerspexProperty
we have a .Changed
observable that fires every time a property of the type changes, and then we have .AddClassHandler
to route the event to the interested class. It might be a tidier to use the same pattern on RoutedEvent
rather than having .AddClassHandler
directly on RoutedEvent
.
Currently once a style is attached to a control it is there for good. Need to allow styles to be removed from the tree, which will cause the style to be detached from all attached controls, and attached to the tree.
...and a fixed Width. Demonstrated in the issue-3-grid-problem branch.
Our Grid implementation comes from Moonlight but was converted from C++ to C#. Maybe the problem arises because that conversion missed something, but I can't see where. Perhaps the problem was also present in Moonlight.
Currently there is now way to just use the default window size - it's either fixed by setting Width/Height or sized to content.
If an adorned control moves then the position of the adorner is not updated. This needs to be fixed by listening for movement of the adorned element and its ancestors.
Would be nice to be able to supply something like "Auto,2px,1*"
to the constructor.
I asked a question about this on SO but got no reply:
http://stackoverflow.com/questions/25852960/what-am-i-doing-wrong-in-my-2d-scene-graph
The issue can be seen easily in the render-problem branch.
Allowing cloning of PerspexObject and all its properties (values) would be usefull, specially brush clones etc.
We only use it for two things:
It's not particularly well suited to our needs for either.
@SuperJMN had some ideas about refactoring service location. Something will need to be done about logging.
So as not to need a separate install of GtkSharp. This way, we can move to a single solution for both Window and Gtk.
DropDown needs a bit of work to match the standard ComboBox keyboard behavior on Windows:
Using OmniXAML.
Just to point it out!
To allow us to have rounded corners on borders.
https://github.com/grokys/Perspex/blob/master/Docs/intro.md
links to
https://github.com/SuperJMN/Perspex/tree/fuent-api. Which is no longer available.
What happend to it?
WPF StackPanel implements IScrollInfo thus when the user press PageDown, PageUp the content scrolls by one, need to
add some sort of scroll content to ScrollViewer, this is handled by IScrollInfo in WPF.
One of the fascinating things of wpf is is's using non effiicently but fast a retained mode and directX3D.
I was interested in making Perspex runing in an opengl window and maybe even with 10bit per channel.
Have you forseen this in one or another way?
I'd be also interested in doing it.
Would be a nice feature to have out of the box.
Random list of tests to write, as I think of them while doing something else...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.