« first day (1720 days earlier)      last day (1460 days later) » 
00:00 - 22:0022:00 - 00:00

10:00 PM
what jumped at me was the chained where conditions though
 
@MathieuGuindon GTK
I can make the changes later tonight.
 
and the opportunity for method groups
 
Well I know that R# knows more than I do.
 
:D
Once I thought R# was wrong. Turns out I was wrong, so....
 
i.e. things.Where(thing => IsThing(thing)) can always be turned into things.Where(IsThing) -- but that negation operation is thwarting it
 
10:01 PM
hmm. !things.Any(IsThing)?
 
sure, but you can't do .Where(!IsThing)
 
things.All()
 
just to be clear --- !things.All(IsThing) ?
since we want the negation of all methods?
not sure that's logically equivalent.
It might actually be a case for things.Any(IsNotThing) :-D
 
I almost suggested it, but it didn't feel right
 
10:04 PM
I don't blame you.
 
it just tickles my OCD
 
I generally frown on negative methods.
 
I'd just invert the return value of all the functions and all it a day.
 
I'm having a very, very weird problem with my WPF app
 
Oh wait, no, I'd refactor the whole thing - that's right.
 
10:05 PM
^ here the From/To currencies are dropdown columns
 
@this The performance of that module sucks. Didn't I comment on that?
 
@Comintern so we can just leave it is until it's properly refactored.
Yes you did
(it's resolved)
 
the minute I navigate away from the view, and go back, every record is dirty, and the dropdown values are wiped out
 
Yeah, I think I suggested leaving it alone ATM.
 
i might at least at least add a TODO
 
10:06 PM
(other than the order)
 
...but only for the virtualized rows that were visible before I switched the view
 
WTH?
 
Is the binding just getting broken?
I'm assuming it's statically bound, right?
 
no
the available dropdown values are coming from the Sage db
the grid rows are in my app's db
 
10:09 PM
Do the currencies change though?
 
seeing how validation thinks the values are null, it looks like it
on the bright side, my validation code works
 
No, I meant the available currencies to choose from.
 
depends which Sage db you're connecting to
 
so, yeah
(there's a dropdown above the grid for that)
also, it's not just that view... it's all of them - categories, models, fabrics, styles, bill of materials, ...and exchange rates
 
10:12 PM
Does it do the same thing with row virtualization disabled?
Or is that too slow?
 
@Duga good to merge then?
@Comintern good question, hold on
yup, same thing
wait, looks like I need to explicitly disable it
 
@MathieuGuindon I plan to incorporate your other suggested changes
 
@Comintern it's noticeably slower, but same problem
@this ok!
 
What is it bound to? An ObservableCollection<T> or a ListCollectionView?
I've noticed that newing either of those up to replace an old one can trash bindings.
 
hmm
<DataGridComboBoxColumn Header="From"
                        ItemsSource="{Binding Data.Currencies, Source={StaticResource CurrentView}}"
                        SelectedValueBinding="{Binding FromCurrency, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True}"
                        SelectedValuePath="Code"
                        EditingElementStyle="{StaticResource ReadOnlyCodeNameDropdown}" />
 
10:17 PM
In the RD VMs, I've been trying to .Clear() and reload the underlying collections rather than replace them.
 
    private IReadOnlyList<ICodeName> _currencies;
    public IReadOnlyList<ICodeName> Currencies
    {
        get
        {
            return _currencies;
        }
        set
        {
            if (value != _currencies)
            {
                _currencies = value;
                OnPropertyChanged();
            }
        }
    }
 
That should be observable, no?
 
hm, possibly. I had them bind OneTime earlier, but then that was causing a problem where switching the sagedb wasn't reflecting on the available data
possibly yes.
doesn't fix it though
 
Something like this:
        private ObservableCollection<ICodeName> _currencies;

        public ObservableCollection<ICodeName> Currencies
        {
            get => _currencies;
            set
            {
                _currencies.Clear();
                if (value is null)
                {
                    return;
                }

                foreach (var currency in value)
                {
                    _currencies.Add(currency);
                }

                OnPropertyChanged();
            }
 
trying to find where in my current changeset I fkd up (it worked fine this morning)
the thing I don't get is that the only thing that changed in the xaml is the binding mode for the itemssource
 
10:25 PM
Actually, you shouldn't even need the OnPropertyChanged(); in there - that should just work from the collection events.
 
yet it's the SelectedValueBinding/SelectedValuePath that's going nuts
 
Wouldn't you expect that binding expression to error if ItemsSource binding breaks though?
 
hmm
@Comintern trying that now
nope
 
Hmmm... My only other thought is that it wants to be in a row template instead of the column header definition, but that wouldn't make any sense...
 
wait a minute...
I do get a bunch of binding errors when I switch the view
System.Windows.Data Error: 40 : BindingExpression path error: 'Currencies' property not found on 'object' ''CategoriesViewModel' (HashCode=51262109)'. BindingExpression:Path=Data.Currencies; DataItem='BindingProxy' (HashCode=48948069); target element is 'DataGridComboBoxColumn' (HashCode=6127836); target property is 'ItemsSource' (type 'IEnumerable')
System.Windows.Data Error: 40 : BindingExpression path error: 'Currencies' property not found on 'object' ''CategoriesViewModel' (HashCode=51262109)'. BindingExpression:Path=Data.Currencies; DataItem='BindingProxy' (HashCode=48948069); target e
 
10:32 PM
Oh duh. It's static.
Source={StaticResource CurrentView}
I'm assuming that's the view?
 
And that's pointed to the datacontext?
 
there's the MainWindowViewModel which is the DataContext for MainWindowControl.xaml
that VM has a SelectedView property
        <!-- captures the current view model for binding elements that aren't part of the visual tree -->
        <local:BindingProxy x:Key="CurrentView" Data="{Binding SelectedView}" />
^ then there's this hack
    private IContentPageViewModel _selectedView;
    public IContentPageViewModel SelectedView
    {
        get { return _selectedView; }
        set
        {
            if (_selectedView != value)
            {
                _selectedView = value;
            }
            HasSelectedView = _selectedView != null;
            OnPropertyChanged(nameof(IsBusy));
            OnPropertyChanged();
        }
    }
^ binds to this. and then I have each usercontrol's VM implement IContentPageViewModel
 
Do you need to bind to the placement target instead of the proxy?
I can't think of why that would be the case...
 
eh, when I showed this in the WPF chat, I could hear them raise their eyebrows:
    <ContentControl Grid.Column="2" Grid.Row="2"
                    ContentTemplateSelector="{StaticResource GridSelector}"
                    Content="{Binding DataContext.SelectedView, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
                    DataContext="{Binding SelectedView}" />
i.e. I have every grid definition in a DataTemplate, then I use a DT selector to determine which one to show
and I make the selectedview (i.e. the selected IContentPageViewModel VM) the ContentControl's data context
 
10:38 PM
Right. Makes sense to me. I guess I don't belong in the WPF chat crowd.
 
the result is essentially RD's settings dialog, but with just one user control and a bunch of data templates
 
Is it possible that the DataContext change isn't getting raised?
No. Then you wouldn't get the exceptions.
 
FWIW these exceptions aren't completely reliable.. I mean, I do get the content on-screen, so..
could be just a timing issue with the many OnPropertyChanged invokes
 
That sounds right - like it's evaluating the Path too soon.
 
Currencies not being found on CategoriesViewModel really smells like it
so, I'm mentally OERN'ing those
 
10:42 PM
lol
Here's an ugly thought from WinForms land. Bind the control itself - not its template.
Wow, that felt evil just to type that.
 
The relative source.
If you add a proxy property, you can bind to that instead of searching it.
 
It would be ugly as hell though.
Just out of curiosity, does swapping the order of the Content and DataContext` attributes make any difference?
I know it shouldn't, but, WPF.
 
lol nah
ugh I need to get to the bottom of this tonight... for now, ttgh
thanks for the 'ducking though :)
 
10:55 PM
i never learn. VBA + typed arrays of UDT => mucho misery
 
this is why whenever I think "I know! I'll make a UDT!" I make a class instead, and the UDT is there, only Private.
 
Yeah I've been doing that lately but in this one instance I didn't. :(
#FML
VBA really really really wants a IEnumerable<T> type.
TODO: Enable generics in VBA.
 
@Comintern VS does not show me more conflicts
 
@AlexisDuque OK, you should just need to commit the merge now.
After that, you'll want push your master branch onto the next branch of origin.
 
11:13 PM
...and once your commits are on your github fork (aka "origin"), you can open a pull request on github; you'll want rubberduck-vba/next on the LHS, and your branch on the RHS
<driving>
 
@Comintern Fusion "Next" with "Master"?
 
Better show a screenshot just to be safe - it sounds backward
 
~/Desktop/Rubberduck-next (next)
$ git merge master
 
@Comintern ^ does that look right?
 
How can I send images through the chat?
 
11:26 PM
easy way is to use github:
copy and paste your image in the textbox
wait for the github to generate a URL
then copy and paste the URL here in chat.
you do not need to create the Github issue; only use the textbox to upload the image.
 
Why are not available?
 
try and right-click those unavailable projects and choose "Reload project"
if this fails, then check git status just to be sure.
 
Sorry, got pulled into a meeting.
If your local master is correct, you'll want to git push origin master:next
I'm not entire clear on why they're showing not available though.
 
@this It worked
 
long ago this did happen to me few times - reloading made it go away
why, I don't know.
:+1:
 
11:51 PM
</driving>
@AlexisDuque great! you should be able to create the pull request now (@Duga will notify here when you do)
looks at screenshots hmm might still need to push the local changes to your github fork
 
00:00 - 22:0022:00 - 00:00

« first day (1720 days earlier)      last day (1460 days later) »