« first day (917 days earlier)      last day (3232 days later) » 

7:12 AM
Hi, people. I asked a question and the answer is failure, it didn't solve. Who can Help? It is about mouse capture.
 
 
1 hour later…
8:31 AM
Hello Everyone!
Could anyone help me with this question please?
1
Q: Scroll ListView to the SelectedItem position

Layale MattaI am building a photo application, using a FlipView and a listView as a Pagination. When I click on the thumbnail picture in the ListView it shows me the same picture in the FlipView. And when I swipe into the FlipView, any photo selected will select the same picture in the ListView. This is don...

 
 
6 hours later…
2:36 PM
morning
So I was hopin one of you guys could give me a bit of guidance. Just the type of control and whatnot I should start with. My situation is that I have a form, whose view model will eventually receive events, which notify the form that some action has been requested of an entity. The entity the event represents may or may not have been encountered before. What I would like to do, is have something like a datagrid, but not (presumably).
When I get these events, I would like to first check if that entity has been seen before, if not, I want to add a new control to my form.
that control will have its own vm and stuff, but I'm not sure what the best way to approach this is.... really the control is going to be something like a rich text box or something, with a small amount of descriptive text in it, and whose background color will change depending on its state.
 
you'd have something like an ItemsControl
 
ah that's it!
 
that takes as its source a list of YourItemViewModels
 
I couldn't remember wth the name of it was
ur the man Julien
thanks
 
3:05 PM
when you right click a video file in windows and go to details tab
it gives you the frame width and frame height
how do you get that information?
i tried Shell32.dll but it seems to only give generic file properties
 
3:20 PM
@Julien winmm.dll?
 
sweeet
ima try it
 
3:35 PM
EF question
i have my Movie model that a collection of Category
now i want to be able to apply a tag against the category for the movie
so you could have a movie that has "Great" Action
great being the tag
action being the category
 
sounds like you got it all figured out :)
 
i dont though
what hsould the structure be
should my Movie model have an ObservableCollection of CategoryTag ?
 
Category might have a Tag, or Rating
 
but its specific against the movie
a category by itself doesnt have a tag
 
are these going to be free-form tags, like on a blog?
and are the tags related to the movie, the category, or the combination of both?
 
3:39 PM
just strings
combination
user inputted
 
i mean, is there some pre-defined list of "valid tags"? or just whatever the user wants to stick on it?
 
I would say Dictionary<Category, Tag> CategoryTags
 
theres no list, inputted at run time
 
I'm tempted to say you could just have a delimited list of tags on the MovieCategory relationship.
then you don't have to manage an object per tag, if they are highly dynamic
 
@NETscape ok that seems like it could work
 
3:40 PM
well if a movie has it, it should be a unique collection of categories, and each category should only have one rating
or tag
 
can the tag be anything?
 
there can be multiple tags per category :s
Dictionary<Category, List<Tag>>
 
like "great;cool;impressive;sloppy" Action ?
 
yeah exactly
 
The fully structured way to do it would be like you just said, for each Movie, have a Dictionary<Category, List<Tag>> Tags or similar structure\
 
3:42 PM
great, horrible, Action?
 
but I have a feeling that might be overkill for a tagging system.
 
lol its just a silly example
 
shouldnt you just have Tags
like Action, ActionThriller, ActionComedy,
 
you'll need to make every tag it's own entity.
 
those are categories, not tags
yeah thats fine i can add them to the db at run time
 
3:44 PM
I think you might be better off having a MovieCategory entity that has a Movie, Category, and TagList, then you don't have to manage your tag list itself.
 
but tags is something you'd search for?
 
depends on the usage, mostly.
 
hm
 
TFS does that, for example, for it's work item tags.
 
uh i dunno maybe. havent thought that far ahead
 
3:45 PM
it's a single semicolon-delimited property on the work item
 
Netflix, shows "Action Comedies" category, not action movies which are funny, interesting, old, etc.
 
if i went the MovieCategory entity route, or the DIctionary route, how does that change what id have to manage
@MichaelEdenfield
 
if you have a dictionary of Tag entries, and someone wants to add a new tag, you have to save a new entity every time, and you'd want to do things like ensure tag entities are reused properly, not duplicated, etc. (or, I would, I'm kinda OCD)
if you just have a string property on your movie/category relationship, it's just an update to an entity you already have.
String.Split() to display tags, String.Join() to save them back
 
right i think i could probably get away with just using a string
oh even having one string. i see
hm
 
having a list of just strings isn't gonna help much. there's no "list" type in SQL.
you need a table.
or you need to put the whole list in one field and manage it yourself. that's basically the two options we're throwing out
 
3:48 PM
options, options
Dictionary<Category, delimitedList>
 
yeah, that would also work. saves you from having to make your join into a true entity.
that's probably what I'd do unless there was a compelling reason you wanted to manage tags as their own entities.
 
basically if i wanted additional properties on a tag
like maybe tracking when it was tagged
 
yeah.
like on SE, you can follow/ignore tags, they track usage, etc. that's easier if they're separate entities, but it can be done either way.
just kinda shifts the work around
(I don't actually know what SE's data model looks like...)
 
i think i will try delimited list
thanks that helps a lot
after lunch :D
 
hey guys
I think im forgetting something simple
but could one of you look over this and see what I did wrong?
Items control:

        <ItemsControl Margin="908,102,10,57" ItemsSource="{Binding Path=PickModules}" Background="AntiqueWhite">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="20" />
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border Grid.Column="1">
 
4:01 PM
whats wrong with it?
 
related methods:

        private PickDevice AddPickModule(PickDevice dev)
        {
            if (!_PickModules.Contains(dev))
            {
                _PickModules.Add(dev);
                PropertyChanged(this, new PropertyChangedEventArgs("PickModules"));
            }
            else
            {
                foreach (var pm in _PickModules)
                {
                    if (pm.Equals(dev))
                    {
                        return pm;
                    }
                }
 
ahhhh. use a gist please
 
@MarkW you don't called prop changed on a colleciton
you use an observablecollection
 
so just change the type on the PickModules property?
 
assuming the problem is that your list isn't updating, yes
 
4:03 PM
that's exactly the issue
:(
still no dice
ill try to gist it
 
also,
int index = _PickModels.Index(dev);
if(index < 0) _PickModels.Add(dev);
return dev;
 
good call
 
what does your PickModules property look like, just return _PickModules?
they both should be ObservColl
 
    private ObservableCollection<PickDevice> _PickModules = new ObservableCollection<PickDevice>();
    public ObservableCollection<PickDevice> PickModules
    {
        get
        {
            return _PickModules;
        }
    }
    private PickDevice AddPickModule(PickDevice dev)
    {
        int index = _PickModules.IndexOf(dev);
        if (index < 0) _PickModules.Add(dev);
        else
        {
            return _PickModules[index];
        }
        return dev;
    }
I can confirm that I get into that AddPickModule method
it adds it correctly
nothing happens on the form though
 
The property type actually doesn't matter
just the underlying type
 
4:13 PM
idk about gist
 
Your code at this point looks correct
 
I haven't used it in forever
and the Create public gist button is perma greyed out
yeah that's what I thought
I sorta copied most of this from my other project
which I do pretty much the same thing
this is the class that is in that observable col
public class PickDevice : INotifyPropertyChanged
    {
        public PickDevice(int devID)
        {
            _DeviceID = devID;
        }

        private int _DeviceID;
        public int DeviceID
        {
            get
            {
                return _DeviceID;
            }
        }

        private bool _IsLit;
        public bool IsLit
        {
            get
            {
                return _IsLit;
            }
            set
            {
                _IsLit = value;
 
yeah that's where I am
got an account and signed in
 
+ button top right
 
4:15 PM
but no matter what I interact with the 'Create public Gist' button is greyed out
 
there is no create public gist button
theres just a +
 
lol
if you say so
 
has a tooltip of "new gist"
 
yep
which opens a form to enter in text
 
type some stuff in...
 
4:16 PM
is your datacontext set correctly?
 
yeah the rest of the bindings on my main form work fine
 
you cant create an empty gist
 
I know
 
hey uhhh
your VB is getting to you
Grid.Column is 0 based
 
lol
wtf
 
4:18 PM
you have 2 columns, so Grid.Column = 0 and Grid.Column = 1
not 1 and 2
 
hum changed it, still no dice, but let me verify that its still getting into that Add method
yeah
added it ok
damn
that seemed like it was the answer
as for Gist.... when I enter in the source and give it a title and a description, there are two buttons at the bottom. One says Create secret Gist the other says Create Public Gist
I can click the create secret one, which I haven't yet
but the public one is always greyed out
and clicking the secret gist button does nothing
lol
 
have you created too many public gists?
 
I haven't used gist in forever
 
for your account
they are saved to your account
Change ItemsSource to Selector... see if you can select items after you add them, try to see if the template is what is the problem or if it is the binding
or use snoop
and get out of here with your drag and drop haha Margin="908,102,10,57"
 
lol
im just trying to make it work at this point
when it renders something ill worry about it being pretty and all that
and my gists list is empty
I evidently don't have any
 
4:25 PM
ah. interesting
 
yeah... idk
its 'don't work for Mark' day over here
 
@BradleyDotNET your favorite person hasn't been around in awhile... how nice.
mr. i refuse to do anything myself
 
not me I hope :P
 
design question coming up
(no not you mark, you acutally caught on haha)
 
heh
 
4:27 PM
I have a user create a communication profile
port name, baud, parity, etc.
I have to communicate to a Device (slave)
so I have a Master class
should I call Master.Read(commprofile), or should I call MasterManager.GetMaster(commprofile), which calls new Master(commprofile) if a new master has to be created
 
@NETscape Indeed
Kyle is very refreshing in comparison
 
i'm sure other guy finished his project and won't ever touch it again
 
Main Form XML (only the ItemsControl isn't working) http://pastebin.com/jMYKGUbc

VM http://pastebin.com/DDVq5h77
 
I sure hop so
 
or come in here
 
4:31 PM
that code was a mess, and he has a way to go in learning to learn
@NETscape Honestly, I'm not sure I have enough info to say
My guess would be the second one
@MarkW Is it still not working?
 
nope
mocks me
 
use Snoop or something
 
Ill try
 
output window, no warnings?
 
nope
first place I checked
you guys have directed me there often enough :)
 
4:34 PM
i think what you need is a working example in your project
i would recommend making a new usercontrol just to test
give it an items control
and see if you can make the simplest possible case work
 
Really dumb question, you do actually get into the add part of that if, right?
 
yep
I can see at runtime the collection has entities
these 33's roll in over a TCP connection
I detect them and call add
you can see that in the big case statement in my VM
case "33"
 
right
 
but I will do that Julien
ive accomplished this before
 
im sure if you get a simple case working
 
4:36 PM
so I don't know why I suck today... but its becoming a theme
 
you will be able to see the diff between the two
 
can also set breakpoints in the getters and see if they get called
populate the list with hardcoded objects and see if at startup it shows items
if not, your binding isn't working. a spelling error or something
also Path= isn't required
and you have RS2323ID... theres an extra 3 it seems :)
 
lol yes there is
nice catch
 
and did you try to change to Selector?
 
not yet
 
4:38 PM
cause your borders have no thickness
 
working through adding static items
 
so you wouldn't be able to tell if anything is showing up in the list or not
because you can't select items either
 
ill check that quick
2 an appropriate value for testing?
I had not really resolved on an actual style yet for the components
Iw as only really worried about getting something on the screen to debug the logic
 
right, border won't do you good though without setting a thickness. could just use <Rectangle Fill="Orange" Height="100" Width="100"/>
i love mvvm/xaml, jeez. so many ways to do everything
 
^ no doubt
 
4:42 PM
omg @BradleyDotNET. lol thanks for advice. just double checking my thoughts
hey @BrianJ hows it going
 
so adding a static item works
it appears to be how the collection notifies the framework
of a change that is...
 
hey @NETscape going good, presented my FYP project today :)
nearly finished college, just exams now
 
Sorry, just to clarify, a different add worked? Or was that just an initial collection member
 
good luck! how did presentation go
 
I made a default constructor in my VM, that added a static item to the collection.
that item appears in the list
 
4:45 PM
@NETscape it went well, only criticism was that I should have individual user tables, at the moment all the records are pushed to one table
 
I see, so thats still not going off of NotifyCollectionChanged
 
so not very scalable
 
yeah
 
individual user tables? wat. 1 table for each user? nooo
 
@BrianJ Tables for each user? In a database? ummm.. no thank you
Your profs are full of crap
 
4:46 PM
wtf
lol
that's pretty bad design...
 
maybe I haven't explained it correctly, they said I should have multiple users, in my current implementation, all records are pushed to the Item table. I suggested that I could just filter the data using linq by user
 
you might have a table for users, and a table for device data, with user id as the pk or something
 
yeah @NETscape I think that's what he meant
 
User Id as a FK for me, but yeah
 
fk's and pk's
 
4:47 PM
But thats very different than a table for each user
 
pk being the itemId or whatever
 
im going to go get some lunch
thanks for your help so far guys
ill keep hacking away and come back here later
 
i'm no db god, our professor for db class sucked. he just giggled and squinted his eyes while speaking in a heavy chinese accent
 
lol racist!
 
I'll link you the table schema
 
4:49 PM
@MarkW haha. plot twist, he was white, so that makes him racist?! haha just kidding.
 
My DB prof was pretty good, not that I remember half the SQL syntax
 
he sucked cause he didn't teach normalization effectively
 
I think I'll miss college, out into the real world now lol
 
Normalization is fun :)
 
i can see the fun in it now, but in school i wasn't into it because he made it make no sense
 
@BradleyDotNET is it normal to have your model exposed via a property in the VM?
manager.SelectedProfile.Profile
where SelectedProfile is ProfileViewModel
maybe if profile is marked internal?
 
Is profile basically a POCO?
 
not sure what he wanted me to do exactly..
 
for the most part yeah
 
@BrianJ Yes, I could see your User string easily being a FK into a User table
@NETscape Then yes, thats fine
at least in my "POCOs float between layers" world :)
 
4:53 PM
okay
 
Hello all
 
I figure there wouldn't be any other way to really say, give me a profile, then give me a master, then read.
hey bill
 
well, you could do a bunch of transforms, but it would be ugly
Hi bill
 
so I would have a table for users, how does the user FK tie into that, as in how would I implement it?
 
Do you have any idea what a foreign key is?
The fact that you can't see a refactor this simple... disturbs me a bit.
Especially since you are graduating
 
4:59 PM
yeah its a reference to the PK user in my main Item table
just not sure how I would implement the solution
 

« first day (917 days earlier)      last day (3232 days later) »