These are chat archives for AvaloniaUI/Avalonia

27th
Dec 2015
danwalmsley
@danwalmsley
Dec 27 2015 00:05
ah ; should be ?
:D
Reed Copsey, Jr.
@ReedCopsey
Dec 27 2015 00:55
@grokys use paket instead. It just works ;)
NuGet just always is a pain
Darnell Williams
@Seeker1437
Dec 27 2015 01:44
@/all is there ever a reason a control might need to know what thread it's running in for Perspex?
I am porting over a control from the wonderful.Net and it checks that it is only being accessed from the owning thread it was created on.
danwalmsley
@danwalmsley
Dec 27 2015 01:45
I thought all controls were on UI thread?
Darnell Williams
@Seeker1437
Dec 27 2015 01:45
It is a component of a control but the not the control itself
danwalmsley
@danwalmsley
Dec 27 2015 01:46
Ah I have this with AvalonEdit
i.e. the Control is TextEditor... on ui thread
and it has a TextDocument class to display...
however an application gets access to the TextDocument object
it always has a VerifyAccess call inside the TextDocuments getter
to make sure its been accessed on the owner thread..
thats because the TextDocument object is not thread safe...
so it might be a similar case for you
Darnell Williams
@Seeker1437
Dec 27 2015 01:48
for example this?
if (!IsValidThread())
            {
                throw new NotSupportedException("SelectedDatesCollection cannot be modified because it is owned b a different thread.");
            }
lol
Yeah!
that makes sense
Darnell Williams
@Seeker1437
Dec 27 2015 02:08
Okay so last thing
for Perspex.RegisterDirect should the private variable always be initialized?

for example I am working on a template it like soo

@danwalmsley @danwalmsley @grokys

public static readonly PerspexProperty<$propertyType$> $propertyName$Property =
            PerspexProperty.RegisterDirect<$containingType$, $propertyType$>("$propertyName$", o => o.$propertyName$, 
            (o, v) => o.$propertyName$ = v);

private $propertyType$ _$lowerPropertyName$;

public $propertyType$ $propertyName$
{
    get { return _$lowerPropertyName$; }
    set { SetAndRaise($propertyName$Property, ref _$lowerPropertyName$, value); }
}
ah!
I see it doesn't :D
XD yaya less work for me :D
danwalmsley
@danwalmsley
Dec 27 2015 02:15
@ImaBrokeDude what do you use to create those animations?
Darnell Williams
@Seeker1437
Dec 27 2015 02:17
:D
danwalmsley
@danwalmsley
Dec 27 2015 02:17
cheers
:D
once we have a decent version of AvalonStudio working with debugging... will do a demo in that
Darnell Williams
@Seeker1437
Dec 27 2015 02:17
nice!
Yeah I was curious when I saw how sublimeText did it on their website XD
and then againfromt eh guy who wrote the code I'm porting :D
Darnell Williams
@Seeker1437
Dec 27 2015 04:58
@grokys @kekekeks
  1. What is the Perspex equivalent of Panel.GetZIndex()
  2. What is the Perspex equivalent of WindowState
    • I will need WindowStateMinimized, Maximixed and stuff
  3. InWindow will there be a public Point PointFromScreen(Point point)
  4. in Window will there be a public Point TranslatePoint(Point point, Control relativeTo)
  5. In ItemControl will there be a public static ItemsControl ItemsControlFromItemContainer([PerspexObject / Control] container)
  6. In ItemContainerGenerator where there be an public object ItemFromContainer([PerspexObject / Control] container)
Steven Kirk
@grokys
Dec 27 2015 09:56
Panel.ZIndex = Visual.ZIndex
WindowState = not yet implemented
PointFromScreen = NYI
TranslatePoint = Visual.TransformToVisual returns a matrix which can be used to transform the point
ItemsControlFromItemContainer = we don't have, search up the logical tree for an ItemsControl
ItemFromContainer = use IndexFromContainer and then look up the index in Items
Steven Kirk
@grokys
Dec 27 2015 10:01
WindowState and PointFromScreen should be easy to implement if you want to submit a PR
Darnell Williams
@Seeker1437
Dec 27 2015 12:45
@grokys Thanks! a couple more
  1. How do I use the Matrix from Visual.TransfromToVisual exactly?
  2. PointFromScreen Should it go in IVisual or just Visual?
  3. For WindowState, Not quite sure how I would implement that. Any pointers?
  4. For Visual.ZIndex accessing this is thread safe?
  5. What is the alternative to Dispatcher.BeginInvoke right now I am using Dispatcher.CurrentDispatcher.InvokeAsync
Steven Kirk
@grokys
Dec 27 2015 12:53
to transform a Point by a Matrix use Point.Transform(Matrix)
well Visual.PointToScreen isn't currently in IVisual so probably just put it in Visual
WindowState - add a property to IWindowImpl and implement this in Perspex.Win32.WindowImpl and Perspex.Gtk.WindowImpl
all access to PerspexProperties must be from UI thread - this is the same as in WPF
Dispatcher.CurrentDispatcher.InvokeAsync is correct i think
Darnell Williams
@Seeker1437
Dec 27 2015 13:05
Thanks again!
Alexey
@flcl42
Dec 27 2015 20:12
Looks like paml view can't be loaded on android, and I have to create design using code. Hope am not right.
Darnell Williams
@Seeker1437
Dec 27 2015 21:36
i believe you're but let me check really quick
Alexey
@flcl42
Dec 27 2015 22:09
Xamarin has custom build actions for files of mobile projects and probably support for accessing them is not implemented yet, will check it
Tomorrow