These are chat archives for AvaloniaUI/Avalonia

4th
Dec 2015
Nikita Tsukanov
@kekekeks
Dec 04 2015 00:02 UTC
BTW I really like that KillAllDesigners method name
That could have saved a lot of work for people who are doing HTML markup
Darnell Williams
@Seeker1437
Dec 04 2015 00:12 UTC
hahahahahaha XD
took me a minute to get that
Nikita Tsukanov
@kekekeks
Dec 04 2015 00:19 UTC
I think the problem is that editor margin should also unsubscribe from build events stuff
it will restart designer otherwise
Darnell Williams
@Seeker1437
Dec 04 2015 00:25 UTC
yep, all in cluded
Darnell Williams
@Seeker1437
Dec 04 2015 03:00 UTC
@kekekeks not sure if you are awake, you okay with me adding my Log class?
Wait nvm that would be kinda pointless.... welll... not really
It just depends on whether we should rpoduce our own log or just use the activity log
Darnell Williams
@Seeker1437
Dec 04 2015 03:22 UTC
@grokys @kekekeks the win32exception, that could happen if a file is modified while in use. WIndows has this weird bug of allowing me to copy over a file even while it is in use, you would then have to close the file in use and copy again to fix
probably not even close tot he issue, but this could also mean memory crruption
Nikita Tsukanov
@kekekeks
Dec 04 2015 08:59 UTC
@ImaBrokeDude there is an option of allocating actual console
Controlled by registry key
danwalmsley
@danwalmsley
Dec 04 2015 09:59 UTC
@kekekeks you there?
does this exception mean anything to you?
blob
danwalmsley
@danwalmsley
Dec 04 2015 11:10 UTC
guys im ready to look at implementing IScrollInfo... I really need it now
can anyone guide me on what needs doing?
danwalmsley
@danwalmsley
Dec 04 2015 12:25 UTC
also if you have a control inside another control... only the parent control receives OnKeyDown event...
how can I have the event passed down to the subcontrol?
Darnell Williams
@Seeker1437
Dec 04 2015 12:35 UTC
Really?
You should be able to just register a hotkey on the child control.
Not sure of the exact details but I do remember @kekekeks saying that it flows witht he logical tree for hotkeys.
danwalmsley
@danwalmsley
Dec 04 2015 12:38 UTC
im thinking its because I should have inherited the control
rather than just making it a property
basically I have TextEditor and TextView
Text view renders text and handles selection, and key inputs, etc
and the TextEditor handles loading of documents, etc scrolling ... margins, etc
and texteditor contains textview
im sure iv done it pretty badly though
Darnell Williams
@Seeker1437
Dec 04 2015 12:40 UTC
Even as such you should still have the power (just not in XAML) to listen for the key events :O
Ah but... I see what you are saying yeah
Maybe we can make the textview and attached property (aka PerspexDirectProperty)
and allow for modification that way?
danwalmsley
@danwalmsley
Dec 04 2015 12:42 UTC
yeh
im looking at the relationship between TextPresenter and TextBox
in Perspex
and in my editor TextView is like TextPresenter and TextEditor is like TextBox
i dont understand why TextBox has the key inputs and not TextView....
even when TextPresenter has things like selection start, end , etc
Darnell Williams
@Seeker1437
Dec 04 2015 13:30 UTC
hmmm
danwalmsley
@danwalmsley
Dec 04 2015 13:31 UTC
ah man the standard scroll viewer I cant get to work now!! :(
Darnell Williams
@Seeker1437
Dec 04 2015 13:34 UTC
NOOOO I thought I was on ym fork....
what the hell...
omg omg omg....
I just fucked up really bad....
Shahid Khan
@shahid-pk
Dec 04 2015 13:38 UTC
revert is recomended
i don't know why but seasoned git users don't like force push to upstream master
Darnell Williams
@Seeker1437
Dec 04 2015 13:39 UTC
DOing a revert now
danwalmsley
@danwalmsley
Dec 04 2015 13:45 UTC
anyone know where the templates are say for TextBox in Perspex code?
and other
danwalmsley
@danwalmsley
Dec 04 2015 13:51 UTC
@wieslawsoltes many thanks
Darnell Williams
@Seeker1437
Dec 04 2015 13:54 UTC
ah....
Darnell Williams
@Seeker1437
Dec 04 2015 14:06 UTC
THey are going to kill me
I should have just left that merge there, I think it wiped out a crap ton of changes...
@kekekeks @grokys Before you kill me, I did make a backup you guys can use, I would have just replaced master but it's protected. All you should have to do to fix my mistake is replace master with Mast-back
Darnell Williams
@Seeker1437
Dec 04 2015 14:12 UTC
I thought I was in a different branch when I commited, I did not pay attention to it being set to master
danwalmsley
@danwalmsley
Dec 04 2015 14:13 UTC
guys in your application when you define the template and style in Xaml
how do you tell it where to find your control?
I get
An unhandled exception of type 'OmniXaml.XamlLoadException' occurred in Perspex.Markup.Xaml.dll

Additional information: Error loading XAML: OmniXaml.XamlParseException: The type "{:TextEditor} cannot be found"
<Styles xmlns="https://github.com/perspex" xmlns:local="clr-namespace:AvalonStudio.TextEditor;assembly=AvalonStudio" xmlns:tv="clr-namespace:AvalonStudio.TextEditor.Rendering;assembly=AvalonStudio">
  <Style Selector="TextEditor">
how would it know TextEditor is in my assembly and not the Perspex one?
danwalmsley
@danwalmsley
Dec 04 2015 14:18 UTC
@grokys
Darnell Williams
@Seeker1437
Dec 04 2015 14:22 UTC
oooh yeah
you have to ad your style to the app theme and use the clr namespace for the control itself
Steven Kirk
@grokys
Dec 04 2015 14:33 UTC
hi guys... too many questions
what do you need to know?
if you want to use an xaml namespace in style you should be able to do: <Style Selector="local|TextEditor">
it uses the | character the same way CSS does
@ImaBrokeDude did you fix your mistake?
tbh you should probably develop in a fork and PR to the main repos
myself and kekekeks commit straight to the main repos because we do so much, but i don't think it would slow you down so much
key presses will bubble unless e.Handled is set, just like in WPF
the separation of concerns betweet TextBox and TextPresenter was arbitrary and may well change
is that everything?
danwalmsley
@danwalmsley
Dec 04 2015 14:50 UTC
@grokys many thanks for that! got my template into Xaml now
if your still there
I cant get scrollviewer to work anymore...
not sure why
here is my template:
<Styles xmlns="https://github.com/perspex" xmlns:local="clr-namespace:AvalonStudio.TextEditor;assembly=AvalonStudio" xmlns:tv="clr-namespace:AvalonStudio.TextEditor.Rendering;assembly=AvalonStudio">
  <Style Selector="local|TextEditor">
    <Setter Property="Background" Value="#1e1e1e"/>
    <Setter Property="BorderBrush" Value="#ff707070"/>
    <Setter Property="BorderThickness" Value="2"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="Template">
      <ControlTemplate>
        <Border Name="border"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                Padding="2">
          <ScrollViewer CanScrollHorizontally="{TemplateBinding CanScrollHorizontally}"
                        HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
                        VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}">
            <Panel>
              <Grid Margin="0 5" ColumnDefinitions="Auto, *">
                <StackPanel Orientation="Horizontal" Name="marginContainer"/>
                <tv:TextView Name="textView" HorizontalAlignment="Stretch" Margin="5, 0" Grid.Column="1" 
                                CaretIndex="{TemplateBinding CaretIndex}"
                                SelectionStart="{TemplateBinding SelectionStart}"
                                SelectionEnd="{TemplateBinding SelectionEnd}"
                                TextDocument="{TemplateBinding TextDocument}"/>
              </Grid>
            </Panel>             
          </ScrollViewer>
        </Border>
      </ControlTemplate>
    </Setter>
  </Style>
  <Style Selector="TextBox:focus /template/ Border#border">
    <Setter Property="BorderBrush" Value="Black"/>
  </Style>
</Styles>
and TextView is definately reporting a large vertical size... but no scrollbar
measureoveride isnt getting called on my textview! not sure why
Darnell Williams
@Seeker1437
Dec 04 2015 14:58 UTC
@grokys Yes, but it might do better to replace master with Mast-back
I meant to push my changes to my branch not master xD
Steven Kirk
@grokys
Dec 04 2015 15:05 UTC
why replace master with mast-back? that seems a bit drastic!
3 commits and 3 reverts isn't a big deal
danwalmsley
@danwalmsley
Dec 04 2015 15:06 UTC
@grokys what decides if measureoverride gets called?
Steven Kirk
@grokys
Dec 04 2015 15:06 UTC
@danwalmsley have you tried looking in th F12 devtools to check the measurements?
measureoverride gets called if the control is in the visual tree
danwalmsley
@danwalmsley
Dec 04 2015 15:07 UTC
ok, but before not sure what changed in my code
it was called regularly
if things changed in my control
like loading a new text file
Steven Kirk
@grokys
Dec 04 2015 15:07 UTC
my guess would be that your control is no longer in the visual tree?
have you checked in devtools?
danwalmsley
@danwalmsley
Dec 04 2015 15:07 UTC
now it gets called only when control is created
will check now
Darnell Williams
@Seeker1437
Dec 04 2015 15:09 UTC
@grokys the merge was forced, it seemed to have wiped out some tests and such and I cant tell if they were supposed to be there before
danwalmsley
@danwalmsley
Dec 04 2015 15:09 UTC
blob
its in visual tree but its height is NaN?
Steven Kirk
@grokys
Dec 04 2015 15:10 UTC
it's bounds you're interested in
do you know how WPF layout works? Height vs ActualHeight etc?
Bounds = {ActualHeight, ActualWidth}
danwalmsley
@danwalmsley
Dec 04 2015 15:12 UTC
kind of
probably not that well though
my understanding was Height is WPF unit height
Darnell Williams
@Seeker1437
Dec 04 2015 15:12 UTC
I think your TextEditor is growing outside the bounds of TextEditor
danwalmsley
@danwalmsley
Dec 04 2015 15:12 UTC
and ActualHeight is pixels?
Steven Kirk
@grokys
Dec 04 2015 15:13 UTC
yes
Darnell Williams
@Seeker1437
Dec 04 2015 15:13 UTC
TextView*
Steven Kirk
@grokys
Dec 04 2015 15:13 UTC
if you go up to the ScrollPresenter you should be able to see the size of the Viewport and the child Extents
if Extents < Viewport a scrollbar won't be shown
danwalmsley
@danwalmsley
Dec 04 2015 15:14 UTC
ok just checking
hmm Viewport = 995, 441 and Extent = 42, 10
Darnell Williams
@Seeker1437
Dec 04 2015 15:16 UTC
yep so extent is smaller than the viewport
no scollbar...
danwalmsley
@danwalmsley
Dec 04 2015 15:17 UTC
I dont understand why,,, my editor should just assume the size available on screen
and the TextView should be much larger
Darnell Williams
@Seeker1437
Dec 04 2015 15:17 UTC
the current code is on the repo right?
danwalmsley
@danwalmsley
Dec 04 2015 15:17 UTC
but thats not happening
yeh
on branch basicImplementation
Darnell Williams
@Seeker1437
Dec 04 2015 15:17 UTC
okay let me take a look
danwalmsley
@danwalmsley
Dec 04 2015 15:17 UTC
thanks man
ah you wont be able to get it to load text just with the repo
hang on I'll add something to load sample text in there
Steven Kirk
@grokys
Dec 04 2015 15:19 UTC
if you hover over a control in the tree it will highlight its layout rectangle
danwalmsley
@danwalmsley
Dec 04 2015 15:20 UTC
hmmm when control is loaded
the entire text editors bounds are 1000, 470
im sure it shouldnt be that tall
Darnell Williams
@Seeker1437
Dec 04 2015 15:20 UTC
also shouldnt it be row definitions not column?
danwalmsley
@danwalmsley
Dec 04 2015 15:21 UTC
the column definitions is to get margins on the left
i.e. line numberings and breakpoints
Darnell Williams
@Seeker1437
Dec 04 2015 15:22 UTC
hmmm
danwalmsley
@danwalmsley
Dec 04 2015 15:23 UTC
nearly there with sample text
Kevin
@KeKl
Dec 04 2015 15:28 UTC
in the new nuget package alpha 3 there are the files for the rendering system missing: Direct2D, SharpDX...
in alpha 2 that was in the build folder
Steven Kirk
@grokys
Dec 04 2015 15:29 UTC
i think we add those as nuget packages now
i.e. if you use the "new project" template from the VS extension
which you probably should because things have changed...
danwalmsley
@danwalmsley
Dec 04 2015 15:31 UTC
ok @ImaBrokeDude i've added a sample project to the repo
if you pull now
you will be able to do File->Open
Darnell Williams
@Seeker1437
Dec 04 2015 15:31 UTC
thanks!
danwalmsley
@danwalmsley
Dec 04 2015 15:32 UTC
find the SampleProject folder and open SampleProject.vesln
Darnell Williams
@Seeker1437
Dec 04 2015 15:32 UTC
But it think its taking the height from the line ract
danwalmsley
@danwalmsley
Dec 04 2015 15:32 UTC
then just click on any code file... and you will see no scroll bars!
Darnell Williams
@Seeker1437
Dec 04 2015 15:32 UTC
rect*
danwalmsley
@danwalmsley
Dec 04 2015 15:32 UTC
line rect?
Darnell Williams
@Seeker1437
Dec 04 2015 15:33 UTC
SelectedLineBackgroundRenderer
danwalmsley
@danwalmsley
Dec 04 2015 15:33 UTC
i'll make it not install any margins and see if that fixes it
nah its still the same
good idea though
Steven Kirk
@grokys
Dec 04 2015 15:36 UTC
sorry i can't help more right now guys, got to finish something for work. but i'm sure you'll get to the bottom of it between you ;)
danwalmsley
@danwalmsley
Dec 04 2015 15:36 UTC
i hope so!!
thanks for help @grokys
Steven Kirk
@grokys
Dec 04 2015 15:36 UTC
one idea might be to try creating a similar layout in WPF and see what happens
danwalmsley
@danwalmsley
Dec 04 2015 15:37 UTC
seems that measure overide isnt getting called so it doesnt realise its bigger than it is
since it measured it at the begining
but not once the text has loaded
Steven Kirk
@grokys
Dec 04 2015 15:37 UTC
are you calling InvalidateMeasure?
danwalmsley
@danwalmsley
Dec 04 2015 15:37 UTC
well iv not added that
but it worked in previous version
did a compare of files.. cant see what caused the break though
Steven Kirk
@grokys
Dec 04 2015 15:38 UTC
prev version of perspex or of your code?
danwalmsley
@danwalmsley
Dec 04 2015 15:38 UTC
of my code
man render loop is leaking memory very badly!!!
Steven Kirk
@grokys
Dec 04 2015 15:39 UTC
managed or unmanaged memory?
danwalmsley
@danwalmsley
Dec 04 2015 15:39 UTC
not sure...
just looking at the graph going up when application is under debug
I have caret blinking every half second
causing a redraw
and I increase mem about 1mb every 2 seconds
working on it ;)
danwalmsley
@danwalmsley
Dec 04 2015 15:41 UTC
;) excellent
im about to stab my eyes out on this scroll viewer thing!!!
@ImaBrokeDude did you manage to load a code file?
hmm when MeasureOverride gets called the available size is set to infinity?
thats when control first loads
danwalmsley
@danwalmsley
Dec 04 2015 15:46 UTC
what controls the extent size?
Darnell Williams
@Seeker1437
Dec 04 2015 15:49 UTC
look*
im looking not
now yes got a project to loom
danwalmsley
@danwalmsley
Dec 04 2015 15:50 UTC
for some reason textView height doesnt seem to be set!
Darnell Williams
@Seeker1437
Dec 04 2015 15:53 UTC
yeah I dont like stretch
Steven Kirk
@grokys
Dec 04 2015 15:53 UTC
have you tried doing a git bisect to determine which commit caused the problem?
danwalmsley
@danwalmsley
Dec 04 2015 15:54 UTC
nope but I will do now... i did a large refactoring then the problem started!!!
but nothing jumps out
just did a compare between the 2 versions
@ImaBrokeDude stretch where?
Darnell Williams
@Seeker1437
Dec 04 2015 15:56 UTC
Found it
danwalmsley
@danwalmsley
Dec 04 2015 15:56 UTC
yes!!!
what?
tell me!!!
sorry iv been stuck on this hours!!!
Darnell Williams
@Seeker1437
Dec 04 2015 16:01 UTC
wait hold up
danwalmsley
@danwalmsley
Dec 04 2015 16:07 UTC
@ImaBrokeDude what did you find?
I'm resetting this stuff to Perspex/Perspex@1fddedd
danwalmsley
@danwalmsley
Dec 04 2015 16:10 UTC
@kekekeks did you see my linux error?
i'll send again
Andrey Kunchev
@donandren
Dec 04 2015 16:12 UTC
@danwalmsley have you tried AffectsMeasure(InterestedPerspexProperty) in static contstructor of your control to see the scroll is ok?
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:13 UTC
It seems that exception happends in your code
danwalmsley
@danwalmsley
Dec 04 2015 16:14 UTC
@kekekeks ah I thought it wsa something to do with GTK#
ok no i see now
@donandren will have a look into that thanks :D
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:16 UTC
@ImaBrokeDude your stuff is there https://github.com/Perspex/Perspex/tree/imabroken
Please, make a proper PR
Andrey Kunchev
@donandren
Dec 04 2015 16:19 UTC
@kekekeks I've made some things with the iOS text handling, the textbox looks working now. But on iOS there is no human way (at least i haven't found it) to get keyup/down events, actually only the text that's written from the keyboard is used.
@kekekeks will that be a problem?
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:20 UTC
It's fine to only fire RawTextInputEventArgs events
KeyUp/KeyDown are mainly used for hotkeys and keyboard navigation
We don't need that for iOS
Andrey Kunchev
@donandren
Dec 04 2015 16:22 UTC
ok good next days I'll make PR for that, after ensure it's ok
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:22 UTC
What concerns me is text selection
iOS/Android have built-in stuff for that
I wonder if we can somehow use it
Steven Kirk
@grokys
Dec 04 2015 16:23 UTC
who needs text selection on a phone?
at least iphone users didn't for about 5 years ;)
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:23 UTC
Well, they do have it now and expext apps to support it
Steven Kirk
@grokys
Dec 04 2015 16:24 UTC
yeah, i know, was just a joke at the expense of ios ;)
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:25 UTC
I think they added it when first ipad was released
because people can actually work with office apps on a tablet
Steven Kirk
@grokys
Dec 04 2015 16:26 UTC
was ios3 apparently
Darnell Williams
@Seeker1437
Dec 04 2015 16:26 UTC
@kekekeks yay it was a mistake, Mast-back was the recovery for my mistake, wasnt sure how to reset
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:27 UTC

was ios3 apparently

We can wait for Perspex 3.0 then

Steven Kirk
@grokys
Dec 04 2015 16:27 UTC
exactly ;)
Darnell Williams
@Seeker1437
Dec 04 2015 16:28 UTC
@danwalmsley I thought I found it but I was wrong
Steven Kirk
@grokys
Dec 04 2015 16:28 UTC
ok, i can take a look now
danwalmsley
@danwalmsley
Dec 04 2015 16:29 UTC
@grokys my problem or something else?
Steven Kirk
@grokys
Dec 04 2015 16:29 UTC
yours
Darnell Williams
@Seeker1437
Dec 04 2015 16:30 UTC
its very weird, everything seems like it should be fine
danwalmsley
@danwalmsley
Dec 04 2015 16:30 UTC
ok do you have a clone of my project
basicImplementation branch?
Andrey Kunchev
@donandren
Dec 04 2015 16:31 UTC
@danwalmsley I've quick review your code for memory leaks you should dispose FormattedText, it's very possible to make memory leaks without dispose
Darnell Williams
@Seeker1437
Dec 04 2015 16:31 UTC
me or @grokys
danwalmsley
@danwalmsley
Dec 04 2015 16:32 UTC
@donandren ok cheers I will do that
@ImaBrokeDude grokys
Steven Kirk
@grokys
Dec 04 2015 16:33 UTC
hmm yeah strange. the Grid size doesn't equal the Extent size
i think you may have find a ScrollViewer bug which is why you were tearing your hair out ;)
Andrey Kunchev
@donandren
Dec 04 2015 16:36 UTC
@danwalmsley I've tested TextView with added line for: static TextView()
{
AffectsMeasure(TextDocumentProperty);
}
and measure is called altough the MeasureoVoerride shoud return other value for width not infinity as this causes exception
danwalmsley
@danwalmsley
Dec 04 2015 16:38 UTC
@grokys if I had any hair left
I lost that all about 2 hours ago
@donandren thanks affects measure sorts it
as long as I send back a sensible width
what I dont understand is why the availableSize passed in was infinity?
it wasnt before my refactoring...
btw disposing formatted text made a difference. :)
tbh I should bite the bullet and get IScrollInfo implemented
that would really be much better for this.
Steven Kirk
@grokys
Dec 04 2015 16:44 UTC
ScrollViewer always gives infinity for available size because, well, that's the point of it!
i think there's still a bug in there somewhere
danwalmsley
@danwalmsley
Dec 04 2015 16:47 UTC
hmmm ok right have to drive home... il be back on as soon as I can!!!
thanks for all helping me guys
really appreciate it
first time just now got the text editor running and doing code analysis on Linux all thanks to Perspex :D
blob
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:49 UTC
wow
danwalmsley
@danwalmsley
Dec 04 2015 16:50 UTC
once I get scrollinfo i will port over from Wpf version intellisense
then comes debugging!
not too far off now !
hopefully one of the first Perspex apps will be release soon!
Darnell Williams
@Seeker1437
Dec 04 2015 16:51 UTC
Yeah :D
danwalmsley
@danwalmsley
Dec 04 2015 16:51 UTC
@ImaBrokeDude ... if you get the dock finished ;)
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:51 UTC
It will be slow as frozen hell and crash all the time
danwalmsley
@danwalmsley
Dec 04 2015 16:51 UTC
ok see you guys soon
on windows it runs very fast
Darnell Williams
@Seeker1437
Dec 04 2015 16:52 UTC
And I need to improve gridsplitter fixed so I can get the docking working
danwalmsley
@danwalmsley
Dec 04 2015 16:52 UTC
but in my vm its pretty slow
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:52 UTC
but released, nonetheless
danwalmsley
@danwalmsley
Dec 04 2015 16:52 UTC
haha yeh!!!
im looking forward
ok see you guys
Darnell Williams
@Seeker1437
Dec 04 2015 16:52 UTC
cya
@kekekeks how did you reset? I have to do the same with imabroken
Steven Kirk
@grokys
Dec 04 2015 16:53 UTC
nice!
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:54 UTC
@ImaBrokeDude just cherry-pick stuff to a new branch
Steven Kirk
@grokys
Dec 04 2015 16:54 UTC
@kekekeks did commit an IScrollInfo interface that is split into horizontal and vertical interfaces
but i'm not sure this is the right approach tbh
i'll let you work on it and you can decide
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:55 UTC
There is full IScrollInfo interface
which can be implemented if one wants to use this approach
Steven Kirk
@grokys
Dec 04 2015 16:55 UTC
yeah, just i'm not sure if separate horizontal and vertical interfaces make sense
Darnell Williams
@Seeker1437
Dec 04 2015 16:55 UTC
Okay, yeah, I have locked master from my editing on my side now, can only recieve updates from remote
Steven Kirk
@grokys
Dec 04 2015 16:56 UTC
as the main consumer is ScrollViewer
which supports both
Nikita Tsukanov
@kekekeks
Dec 04 2015 16:56 UTC
Yep, it will just use provided wrapper that implements IScrollInfo
Steven Kirk
@grokys
Dec 04 2015 16:56 UTC
and most scrollable panels will need to support both too
so i'm just not sure there's any point separating into 2
i'm hard-pressed to think of any time both won't be used
Darnell Williams
@Seeker1437
Dec 04 2015 16:59 UTC
only think I dont like about virtualizing panels is the lack of smooth scrolling
Steven Kirk
@grokys
Dec 04 2015 17:00 UTC
i would like to find a way to support that
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:01 UTC
Yep, we can approximate element size from existing data or something
Steven Kirk
@grokys
Dec 04 2015 17:01 UTC
yeah, i think so
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:01 UTC
BTW, we need to decide how much elements virtualizing panel should support
There are implementation that preallocate an array that can hold info about all elements
Steven Kirk
@grokys
Dec 04 2015 17:02 UTC
int.Max i'd say
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:03 UTC
That will require cache management
Steven Kirk
@grokys
Dec 04 2015 17:04 UTC
what info do you need to hold about non-visible elements?
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:04 UTC
Well, height
Steven Kirk
@grokys
Dec 04 2015 17:05 UTC
i think we should just use visible elements like you said
though, having said that
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:05 UTC
We can keep some elements around current visible area
1-2 pages in each direction
Steven Kirk
@grokys
Dec 04 2015 17:06 UTC
how common are lists that have vastly differing item sizes do you think?
we might need an option
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:06 UTC
Well, you see one right in front of you
Steven Kirk
@grokys
Dec 04 2015 17:07 UTC
SmoothScrolling = false for lists with vastly differing sizes
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:07 UTC
Chat log is a good example of list that needs smooth scrolling (because of messages that won't fit into the screen) and virtualization (because history is huge)
Steven Kirk
@grokys
Dec 04 2015 17:08 UTC
hmm yeah good point.
but e.g. in gitter it doesn't work like that
the scrollbar just shows you your place in the currently visible chat
more is loaded when you move to the top or bottom
so i'm not sure it's a perfect example of a virtualized list
your scrollbar thumb would be 1 pixel ;)
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:11 UTC
Well, you can increase minimal scroll step to 5 pixels
And it will still be smooth
Darnell Williams
@Seeker1437
Dec 04 2015 17:11 UTC
the android version is a little more accurate in regards to gitter
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:11 UTC
Or even 50 pixels
Steven Kirk
@grokys
Dec 04 2015 17:12 UTC
well yeah, there obviously is a minimum thumb size
Darnell Williams
@Seeker1437
Dec 04 2015 17:12 UTC
scrolling far in history makes it unload new stuff and visa versa
Steven Kirk
@grokys
Dec 04 2015 17:12 UTC
it does the same here
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:12 UTC
Which isn't good from UX point of view
Steven Kirk
@grokys
Dec 04 2015 17:13 UTC
i think it makes perfect sense tbh
a scroll history of the entire conversation in this room would render the scrollbar unusable
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:15 UTC
Well, Skype doesn't use that method
Darnell Williams
@Seeker1437
Dec 04 2015 17:15 UTC
same I honestly think for performance it's very usefu
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:15 UTC
I have a skype chat with 5+ year history
Loading all history takes ages
Darnell Williams
@Seeker1437
Dec 04 2015 17:15 UTC
skype is weird though
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:15 UTC
But then scrollbar is perfectly usable
And you don't see any difference with mouse wheel scrolling
it just works
smoothly as usual
Darnell Williams
@Seeker1437
Dec 04 2015 17:16 UTC
yeah but it's specialized for that, gitter can onpy what the browser provides, you k ow how that can be
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:17 UTC
Yep
But we can implement something like skype
since we aren't limited by HTML DOM
which doesn't support any virtualization
Steven Kirk
@grokys
Dec 04 2015 17:17 UTC
ironically html controls seem to manage it much better than WPF's
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:18 UTC
Because, you know, browsers get updates every month
And WPF is stuck in previous decade
Steven Kirk
@grokys
Dec 04 2015 17:18 UTC
yeah, exactly
Darnell Williams
@Seeker1437
Dec 04 2015 17:19 UTC
I like that Perspex exists, as long as I dont do what I did this morning, all will be cool :)
Steven Kirk
@grokys
Dec 04 2015 17:20 UTC
looks like there are 3 situations to consider then: 1) all items similar size: use average of displayed (+/- some off-screen) 2) items are lazy-loaded like skype: store cache of already-rendered heights 3) items are crazy-different sizes and not lazy loaded: disable smooth scrolling
Darnell Williams
@Seeker1437
Dec 04 2015 17:22 UTC
idk skype handles the varying size thing well
as you may know that you can submit graphics and such now
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:23 UTC
Well, approximation mode can handle items with different size
We just need to reevaluate whole list height every time when stuff gets scrolled
And move scroll thumb to new position according to the percentage of previous height
it worked for me in WinForms
Darnell Williams
@Seeker1437
Dec 04 2015 17:24 UTC
Yes, I like it
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:28 UTC
We probably need to see how commercial controls handle this stuff
Steven Kirk
@grokys
Dec 04 2015 17:28 UTC
yep, and controls on other toolkits
12,000 lines
just for the virtualizing stack panel
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:30 UTC
Well, my winforms implementation that included rendering was ~3000 lines
Darnell Williams
@Seeker1437
Dec 04 2015 17:30 UTC
Yeah
Wow
12k v 3k
Steven Kirk
@grokys
Dec 04 2015 17:31 UTC
the whole of Perspex.Controls is currently only 4,159 lines
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:32 UTC
And ~1000 lines is Grid
Darnell Williams
@Seeker1437
Dec 04 2015 17:32 UTC
I do believe it will be a complex control
may be like grid size
Steven Kirk
@grokys
Dec 04 2015 17:33 UTC
i think it might be possible to separate the implementation from the panels themselves
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:33 UTC
I guess some guy in MS locked himself in a room with cola and snacks for a week and then was like "hey, guys, look at our new cool virtualizingpanel"
And we should probably do the same
Steven Kirk
@grokys
Dec 04 2015 17:33 UTC
yeah, once we've got the basics down
but we need to do it intelligently, not brute-force it like that
Darnell Williams
@Seeker1437
Dec 04 2015 17:38 UTC
I actually have a software I want to convert to Perspex, virtualizing will be really inportant, smooth scrolling will make it better
@grokys remember when I mentioned embedding dlls? Microsoft actually recommend that over ILMerge
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:40 UTC
Seriously?
Darnell Williams
@Seeker1437
Dec 04 2015 17:40 UTC
Yeah, which I thought was strange
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:40 UTC
Well, that might be better for executables
Since it has less chance of breaking things
But for merging perspex dlls ilmerge should be sufficient
BTW, I'm not sure that we should use ilmerge or move things to shared projects
Darnell Williams
@Seeker1437
Dec 04 2015 17:41 UTC
right and application bootup could be boosted if the libraries do already exist in the local directory
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:42 UTC
So we can produce single dll per platform
Darnell Williams
@Seeker1437
Dec 04 2015 17:42 UTC
It allows giving end users the illusion of being able move the main executable anywhere and have it work
I think we should move less critical things to a seperate library
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:43 UTC
define "less critical things"
Darnell Williams
@Seeker1437
Dec 04 2015 17:44 UTC
Portions of the library that are not required for the application to operate, optional components that might add more ease of use and sucb
Nikita Tsukanov
@kekekeks
Dec 04 2015 17:44 UTC
which are ...?
Darnell Williams
@Seeker1437
Dec 04 2015 17:46 UTC
To be honest idk quite yet, that is only because I dont have strong knowledge of the libraries.
Steven Kirk
@grokys
Dec 04 2015 17:48 UTC
yeah, the proper core libs should probably be merged anyway
as they're not useful separately
Darnell Williams
@Seeker1437
Dec 04 2015 17:49 UTC
But just like portions of WinForms and Wpf there are portions of the library that aren't required for the application to operate. Since we don't use linking, we should only make the core stuff a single library and make the rest of it modular
That helps people reduce deployment sizes for simple apps
Steven Kirk
@grokys
Dec 04 2015 17:50 UTC
yep, things like HtmlRenderer come to mind
DataGrid, Ribbon etc
the reason the core libs are in different assemblies is that i kept noticing that e.g. there were tests for certain controls in the WPF layout code
which is ewwwwwww
(might not have been the layout code but was something like that)
and then i noticed i'd done something similar in perspex
Darnell Williams
@Seeker1437
Dec 04 2015 18:04 UTC
@kekekeks had a chance to look at my pr for perspexVS
Nikita Tsukanov
@kekekeks
Dec 04 2015 18:06 UTC
We also need to exit designer process when Visual Studio is killed
But that's another matter
Or it's already being killed in that case, can't remember that
Is it being called?
I think IWpfTextViewMargin contains IDisposable
So dispose method should be called by VS
Darnell Williams
@Seeker1437
Dec 04 2015 18:09 UTC
Ah I see what you mean
Nikita Tsukanov
@kekekeks
Dec 04 2015 18:10 UTC
It should be modified through
Darnell Williams
@Seeker1437
Dec 04 2015 18:10 UTC
but no
Nikita Tsukanov
@kekekeks
Dec 04 2015 18:10 UTC
It needs to unsubsribe from ModeChanged
Have you checked that Dispose isn't called?
Darnell Williams
@Seeker1437
Dec 04 2015 18:10 UTC
In VS tr textview isnt disposed until the e tire applcation closes
the window is hidden on
close but not fully closed
Nikita Tsukanov
@kekekeks
Dec 04 2015 18:11 UTC
That might break designer when it's reopened then
Darnell Williams
@Seeker1437
Dec 04 2015 18:11 UTC
Hmm true
But when the window is opened again, the iwpftextview is reinitialized
it would make a new designer no matter what
new*
Thats from research
Testing I have had issues doing.
My VS wont build the extension because of se
so.e error
Andrey Kunchev
@donandren
Dec 04 2015 19:45 UTC
@kekekeks @grokys I found a possible memory leak fix for StyleActivator and Selector donandren/Perspex@c13141d
before fix:
Before.png
after fix:
After.png
Testing case - Start TestApplication , click on tab "Input" then click on tab "Button", make memory snapshot and repeat that several times
Steven Kirk
@grokys
Dec 04 2015 19:52 UTC
thanks @donandren i'll take a look at that
you may want to check out the "leaks" branch
i suspect i may have already fixed this particular one, but i'm not sure
Andrey Kunchev
@donandren
Dec 04 2015 19:53 UTC
let me check it with the same test
Steven Kirk
@grokys
Dec 04 2015 19:55 UTC
it may have been fixed by 4fa3c98ca381f1f47706bf9ec3743c18a7f7637a
Perspex/Perspex@4fa3c98
Andrey Kunchev
@donandren
Dec 04 2015 19:59 UTC
blob
This message was deleted
This message was deleted
may be it's from other commits, because Perspex/Perspex@4fa3c98 is making exactly the same thing as mine, but more elegant
Steven Kirk
@grokys
Dec 04 2015 20:06 UTC
yeah, Rx is really elegant if you can find the right solution
but maybe what's from what other commits?
Andrey Kunchev
@donandren
Dec 04 2015 20:07 UTC
it has another difference from mine - mine is caching the matchresult untill the control is detached from visual tree
Steven Kirk
@grokys
Dec 04 2015 20:08 UTC
hmm, i don't understand that - a match is a one-off thing surely?
Andrey Kunchev
@donandren
Dec 04 2015 20:10 UTC
sure, but it holds a StyleActivator which more complex and the same styleactivator is created for the same situation to do the same things multiple times
may be it can be made in a different better way for sure
Steven Kirk
@grokys
Dec 04 2015 20:10 UTC
but the inputs to StyleActivator are tied to a particular control
Andrey Kunchev
@donandren
Dec 04 2015 20:11 UTC
yes
styleactivator is cached for specific control only
otherwise it will not work properly
Steven Kirk
@grokys
Dec 04 2015 20:11 UTC
ah, so if multiple styles in the for the same control use the same selector?
Andrey Kunchev
@donandren
Dec 04 2015 20:14 UTC
don't know whether it's possible the same instance of the selector can be used in different styles fro the same instance of a control. Haven't investigated the sytem there in specific details
Steven Kirk
@grokys
Dec 04 2015 20:14 UTC
i guess it could be yes
though i'm not sure how often that would happen
is the leak you were seeing fixed on the leaks branch then?
Andrey Kunchev
@donandren
Dec 04 2015 20:15 UTC
hm i got the impression that every style has it's own selector instance
nope
Steven Kirk
@grokys
Dec 04 2015 20:15 UTC
it does, but there could be two selector instances with the same selector
that's hard to parse
there could be two separate styles with e.g. Button.foo as the selector
Andrey Kunchev
@donandren
Dec 04 2015 20:16 UTC
ah yes this can be made with code actually
Steven Kirk
@grokys
Dec 04 2015 20:16 UTC
how are you testing leaks?
using dotMemory?
Andrey Kunchev
@donandren
Dec 04 2015 20:17 UTC
with visual studio integrated Diagnostic tool
Steven Kirk
@grokys
Dec 04 2015 20:17 UTC
do you have resharper/dotmemory? it can be used to write leak unit tests
Andrey Kunchev
@donandren
Dec 04 2015 20:17 UTC
when you debug you can make memory snapshot (s) at any time and cmpare between them
no don't have dotmemory and r#
Steven Kirk
@grokys
Dec 04 2015 20:18 UTC
hmm, we have a spare licence
if you're interested in pursuing this further
it's just that being able to write leak unit tests is invaluable
without tests it's hard to have confidence you've fixed something for good...
Nikita Tsukanov
@kekekeks
Dec 04 2015 20:20 UTC
@grokys we need to run that stuff on CI
Andrey Kunchev
@donandren
Dec 04 2015 20:20 UTC
that's an amazing option to have it in the unit (leaks) tests i noticed it and liked it
Nikita Tsukanov
@kekekeks
Dec 04 2015 20:20 UTC
dotMemory has a free console runner
Steven Kirk
@grokys
Dec 04 2015 20:20 UTC
yeah, we should
@donandren if you're interested in pursuing this further you can have a jetbrains licence - let me know
interesting that you say your fixes fixed it and mine didn't though, if they indeed do do the same thing
and they appear to...
Andrey Kunchev
@donandren
Dec 04 2015 20:23 UTC
yes it's very stange
Steven Kirk
@grokys
Dec 04 2015 20:24 UTC
what are the exact circumstances of the leak you're seeing?
Andrey Kunchev
@donandren
Dec 04 2015 20:26 UTC
Testing case - Start TestApplication , click on tab "Input" then click on tab "Button", make memory snapshot and repeat that several times with memory snapshots
Steven Kirk
@grokys
Dec 04 2015 20:26 UTC
what is leaking? ScrollViewer?
because i'd noticed that, and i've written a test for it but still not managed to fix it
Andrey Kunchev
@donandren
Dec 04 2015 20:27 UTC
StyleActivator Instances and other related PriorityValues
Steven Kirk
@grokys
Dec 04 2015 20:27 UTC
ah ok
they may be related to the scrollviewer...
i know how to fix that leak, just haven't managed to do it yet ;)
Andrey Kunchev
@donandren
Dec 04 2015 20:28 UTC
but the priorityvalues and the other small objects are realated to StyleActivator observables to control properties
Steven Kirk
@grokys
Dec 04 2015 20:28 UTC
and ExpressionObserver?
Andrey Kunchev
@donandren
Dec 04 2015 20:29 UTC
nope
may be
in my code handling of detach from visual tree is disposing directly StyleActivator in your code detaching from visual tree is related to style and may be actually these are not the same things
Steven Kirk
@grokys
Dec 04 2015 20:32 UTC
ah! hold on
there's a load of stuff i've not pushed yet
could you pull and try again?
Andrey Kunchev
@donandren
Dec 04 2015 20:32 UTC
sure
Steven Kirk
@grokys
Dec 04 2015 20:36 UTC
styleactivator is an observable so disposing and completing should be the same
i say should... ;)
Andrey Kunchev
@donandren
Dec 04 2015 20:37 UTC
blob
Steven Kirk
@grokys
Dec 04 2015 20:37 UTC
no difference?
Andrey Kunchev
@donandren
Dec 04 2015 20:37 UTC
still gaining 5000 c# objects between click between first two tab
50000
no difference
Steven Kirk
@grokys
Dec 04 2015 20:38 UTC
:(
what did your changes do? take it down drastically?
if so, it looks like there's a bug somewhere because the two should be equivalent
storing a list of activations might actually the best things to do though for other reasons (i.e. it would allow removing styles)
Steven Kirk
@grokys
Dec 04 2015 20:44 UTC
though that could also be achieved with TakeUntil i guess
we really need unit tests to ensure that StyleActivators are released
Andrey Kunchev
@donandren
Dec 04 2015 20:52 UTC
btw in the leaks branch StyleActivator.Dispose is never called
Steven Kirk
@grokys
Dec 04 2015 21:18 UTC
it should clean up everything on completion so dispose shouldn't need calling
the disposable returned by Subscribe will only unsubscribe the subscription. Also if the source completes, like in your case, the unsubscription is done automatically
if that's not happening, it's a bug
Darnell Williams
@Seeker1437
Dec 04 2015 21:22 UTC
look at the second answer
José Manuel Nieto
@SuperJMN
Dec 04 2015 21:33 UTC
Hey friends! first bug in OmniXAML now fixed: SuperJMN/OmniXAML#60
Darnell Williams
@Seeker1437
Dec 04 2015 22:02 UTC
@grokys Is there a safe way to play with the measure for Grid?
José Manuel Nieto
@SuperJMN
Dec 04 2015 22:03 UTC
Second fixed issue! SuperJMN/OmniXAML#61
@grokys, thanks for your code. It has been useful to spot the cause of #61. You definitely have a lot of knowledge about OmniXAML, already
Steven Kirk
@grokys
Dec 04 2015 22:07 UTC
glad i can be of some help even if it's not the right solution! ;)
@ImaBrokeDude play with the measure for grid?
Darnell Williams
@Seeker1437
Dec 04 2015 22:08 UTC
Yeah, GridSplitter doesnt handle some of the stuff I need
Andrey Kunchev
@donandren
Dec 04 2015 22:09 UTC
@grokys think i found the problem in the leaks branch adn what's the difference
Darnell Williams
@Seeker1437
Dec 04 2015 22:09 UTC
Or maybe it does and me still being wpfified just dont know what to do hehe
Im working on a more advanced Tab control, it uses the grid splitter heavily to handle tearing and docking
José Manuel Nieto
@SuperJMN
Dec 04 2015 22:13 UTC

glad i can be of some help even if it's not the right solution! ;)

@Grokys it was right! in essence, the code I commited is the same as yours

It's your code
:D
thank you!
working on another issue ATM (#62)
Darnell Williams
@Seeker1437
Dec 04 2015 22:20 UTC
yay wow
@SuperJVM you rock
I must bask in your code
José Manuel Nieto
@SuperJMN
Dec 04 2015 22:23 UTC
hey @grokys, just a quick question.
regarding #62. Can you try this XAML to see if it works?
<ListBox Name="foo">
   <ListBoxItem>Hello</ListBoxItem>
</ListBox>
The very same XAML that doesn't work, but with ListBox
I'll continue tomorrow. Time to go to bed! Tired as a donkey :)
see you!!
Darnell Williams
@Seeker1437
Dec 04 2015 22:26 UTC
night
Steven Kirk
@grokys
Dec 04 2015 22:28 UTC
will try tomorrow!
Andrey Kunchev
@donandren
Dec 04 2015 22:37 UTC
@grokys donandren/Perspex@f1d680c these changes are making the leak in the specific test case dissapear
Steven Kirk
@grokys
Dec 04 2015 22:41 UTC
great! i will take a look tomorrow!
Andrey Kunchev
@donandren
Dec 04 2015 22:43 UTC
nice