« first day (1721 days earlier)      last day (3230 days later) » 
02:00 - 21:0022:00 - 00:00

10:05 PM
@Pedram if you use OC<T> that will work
 
@ReedCopsey yes i noticed it's not working still , so i tried using OC now , i Changed all the List to OC , but no different yet , should i add a new handler with this :
        public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
My Code atm is :
       public class UpdateStatusBar : INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
            public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
            public ObservableCollection<string> WalletResults = new ObservableCollection<string>();

            public ObservableCollection<string> SetWalletResults
            {
                get { return WalletResults; }
                set { WalletResults = value; OnPropertyChanged("SetWalletResults"); }
 
You don't need the collection changed events
how are you adding items and binding?
 
My binding is
<ListBox x:Name="AddWalletResult" VerticalAlignment="Top" Height="235" Width="580" Margin="0,55,0,0" ItemsSource="{Binding Path=SetWalletResults}"></ListBox>
 
typically, WalletResults would be a property, and SetWalletResults wouldn't be there at all
 
i put add item using this :
Obj.SetWalletResults.Add("Process is Finished !");
i tried different approach before this , it was better i think , instead of Adding directly into Obj , i added it into a OC each time , then send the whole OC to Obj.SetWaleltResult = myOC
 
10:17 PM
@Pedram I could be wrong, I'm bad at WPF data binding, but I'm going to assume that when you call Obj.SetWalletResults.Add, SetWalletResults returns WalletResults which then has Add called on it. When Add is called, WalletResults will fire it's changed event but your listbox is only listening for change events on SetWalletResults. But @ReedCopsey should verify.
 
it should be fine
but there's no reason to have a setter on SetWalletResults
 
It will probably work if you bind to WalletResults instead.
 
how can i modify my class to only have WalletResult ?
 
just take out SetWalletResults, and change your binding path to WalletResults?
 
so ... no setter or getter on WalletResults is needed ?
 
10:20 PM
you can put { get; set; } on the end, but it doesn't really do anything for you.
 
getter is needed you cant bind to fields (yet)
 
The code OnPropertyChanged("SetWalletResults"); would only get called when the object is instantiated.
@JohanLarsson ah, then yes @Pedram use the { get; set; }
 
    public class UpdateStatusBar : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private readonly ObservableCollection<string> _walletResults = new ObservableCollection<string>();

        public ObservableCollection<string> WalletResults
        {
            get { return _walletResults; }
        }

        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
@Pedram try ^
inpc not needed but I kept it
 
k Tnx lemme try
 
colchanged event was wrong
 
10:26 PM
@JohanLarsson didn't work :| i tested with 3 input , should have gotten 3 Line of Error
but nothing happened
and when i changed between Tabs
and come back
1 Line only was writen
 
something else is wrong then
 
I like to use caliburn.micro for my WPF stuff because binding is naming convention based. It works pretty well and they have good tutorials.
 
For Adding i'm currently using it like this :
MainWindow.Obj.WalletResults.Add("Error");
Should i maybe , Add it to another OC then send the whole OC each time
to WalletResult ?
 
are you adding to the listbox?
the vm is not updated by doing it
 
I'm Adding to the OC u made in the code u gave me
    public ObservableCollection<string> WalletResults
hmm can't do this , coz u set it as Readonly lol , gotta change the code if i want to Add to Another OC and Send the whole OC to this OC
ah no that ReadOnly have nothing with it , it say Readonly coz we didn't put a Setter on it
 
10:38 PM
@Pedram I think not, Would be surprised if MainWindow.Obj.WalletResults points to it
pretty sure it points to x:Name="AddWalletResult"
 
Just a Question
 
er :)
 
my Binding is to WalletResults right ?
or should i bind it to _walletResulls ?
 
Binding to WalletResults is fine, I just think it isn't actually bound.
Did you just make an instance of UpdateStatusBar in your code behind?
like var Obj = new UpdateStatusBar()?
 
shouldn't i write this somewhere ?
OnPropertyChanged("WalletResults");
 
10:42 PM
@Pedram nope bind to the property
 
@CuddleBunny yes , i made an obj and sent it to this.context
@JohanLarsson just tested , if i add a Setter and put this on it : OnPropertyChanged("WalletResults");
it will update the info
i get all 3 error
 
something is strange with that
 
lol ye, another thing that is weird is , when my background worker actually connect
and go into program
and not give error
i don't receive all the lines ... only the first one
 
Probably just how everything is hooked up, maybe take a look at this: c-sharpcorner.com/UploadFile/e06010/observablecollection-in-wpf
 
hard to remote debug
 
10:51 PM
aaaaaah so weird :|
my class is like :
if (!Logged)
{  myOC.Add("Error")
Obj.WalletResult = myOC;
}
else
{
// do some stuff
myOC.Add("Result stuff")
Obj.WalletResult = myOC;
}
this is in a For Loop ! i send 3 item to check ! if i am not logged ! it give 3 error
but if i am logged ! it give only first one !
even tho i check
and it will DO check them all and DO add them all to the property ...
WTF
 
11:44 PM
Can someone help me with JSON serialization? When i load the file it has this:
\"num\":Infinity
But when I serialize it again it has:
\"num\":\"Infinity\"
Why does NewtonSoft.json add those quotes when num is float, not string.
 
i don't really know and going to sleep atm , but if all else failed :P
use a Regex Replace or something , and fix it each time after u serialize it :P only if it's for infinity though , if it's for more than this , better find a real fix
 
There must be something else wrong too, fixed that one Infinity (The only one) and checksums still don't match
 
02:00 - 21:0022:00 - 00:00

« first day (1721 days earlier)      last day (3230 days later) »