« first day (915 days earlier)      last day (3234 days later) » 
06:00 - 22:0022:00 - 00:00

6:29 AM
anyone there?
 
 
4 hours later…
10:38 AM
Morning
 
 
3 hours later…
1:52 PM
ayee
 
elo
 
2:17 PM
hello All
0
Q: Geoprocess for Download of ShapeFile ArcGIS Silverlight

akirtiRelated to this post I have a button on map. when User clicks on the button and chooses the Dynamic layer Projected On Map.user they should be able to download zip or shapeFile etc. For which we have a service for Extract Data Task. I have to use this service to generating file and download file...

can any one please help me in this
 
probably not. but you might want to add what you've tried to your question
 
2:55 PM
why can't i install win xp vm on hyperv?! wtfff
 
3:06 PM
cos it be too shit
 
 
1 hour later…
4:25 PM
morning all!
 
morning
 
Hey @BradleyDotNET just got done reading through the event documentation you pointed me at yesterday. That's probably one of the best MS pages I've seen. An example and everything! Thanks for pointing me at it.
Is the word 'Changed' a reserved or special word in C#? I see it used a lot, but it's tough to know if it's something I have to define or if it's part of the guts of the language
e.g. List.Changed += new changedDelegate(myMethodToGetCalledWhenTheChangeHappens)
Extending that, are there others such as Click that I can use and assume they exist, and if so is there a concise list of those somewhere or are they just scattered around the .Net API docs?
Something like this, but for events that are in the always-included namespaces: visualcsharptutorials.com/reference/list-of-reserved-keyword
So if I want to use delegation to have the commands in my VM call Frame.Navigate() on my View/Code-Behind, then the VM has a delegate method which is something like 'GoToDifferentPage(string pageIdentifier)', and the view, in the code-behind, does something like VM.Click += new GoToDifferentPage(methodThatDoesTheFrame.NavigateCall)
Is that right? It seems to me like that's really putting a lot of view-knowledge and navigation-knowledge in the VM, so that doesn't pass the smell test
that, and .Click sounds like the wrong event to link to... recommendations on a better choice there?
Oh waitasec, this line makes there be a .Changed event that can be called on the class that contains it, right? public event ChangedEventHandler Changed;
So I could do something like public event GoToAnotherPageEventHandler GoToAnotherPage;
And in my code-behind I can do VM.GoToAnotherPage = new GoToAnotherPageEventHandler(myMethodThatPushesToAnotherPage);
Is that correct? And more importantly, is that a good thing to do? (i.e. proper)
 
5:06 PM
Ok, working through your questions....
No, Changed is not a reserved word
Events like Click are on the Control class, so there is a list, but only for that class
They do use the generic EventHandler delegate though...
Your VM navigation isn't quite right :) Might have to do with you not understanding there are no "standard" events
Yes, that line declares in event
And yes, you could do what you just said
I would do a generic delegate instead of a custom event handler one, but I'm lazy :)
And then instead of instantiating the delegate, just += against a method that matched the signature
that said, there is nothing wrong with the way you did it
just don't be surprised if you see the other way in code as well :)
 
It still kinda raises my eyebrows to have something in my VM that's clearly indicating that the view needs to change... is that one of those things you just kinda have to live with when using MVVM because the transitions to things outside the current context isn't really handled? Or is there something else I should be doing in terms of organization?
Somewhat unrelated question: I've got some public static const strings defined in my VM class that I want to use so I don't have to worry about typos (different commands should send me to different pages)... but they don't seem to be usable outside of the VM class. As in, they're not recognized as static members of my VM class. Any idea why that might be happening, or any suggestions as to how to handle global constant strings like that?
 
your view models can still raise events signifying a logical procession through your logic
that is still independent of any views
 
Maybe it's a naming thing then. When I name the method 'GoToADifferentPage'... that name is really indicating a strong tie to views. Or is it that that method could get called from anywhere, not just the current view, so it's okay to have it in the VM, conceptually?
BTW, good morning @Julien =)
 
it depends on the specific case but it can be a naming things
i like to keep references to my main view models in a global static class
for eg all my main page vms
 
5:21 PM
On the first one, what Juilen said :)
I would name it "StartGame" for example, if I wanted to go to a game page
the event, that is
Not sure on your second one, though I try to avoid static anything
makes testing not fun later
 
Okay, will try and take out the static bit, but that'll make me pass around the vm in my goToAnotherPage() method... which I'm not even sure I can do
Maybe I can make my vm just an ivar in the code-behind, that'd probably do it
 
Thats a bit... smelly
 
Or pull from this.DataContext. That'd probably work too
 
which, by the way static tends to hide
 
No doubt
If I wanted to have a list of global constant string 'variables', where would I put that? In App.xaml.cs?
Or is that not a recommended approach one way or another?
 
5:30 PM
id use a static class
Globals.cs
 
Yeah, I think I've seen that general approach before in different languages/environments
 
i mean, static classes can be bad
but they have their uses
holding onto unchanging application wide values is one of them
this EF stuff is driving me crazy
more and more tempted to drop it and switch to sqlite
 
5:49 PM
@Julien EF is an ORM
SQLlite is a DBMS
you don't just "switch"
Globals.cs is alright, as long as everything is a constant
If you are storing actual objects in there you have issues
 
"replace all my EF database manipulation code with Sqlite"
 
Again, sql lite is a DBMS, not an ORM
they may have an ORM you can use with it
 
they do
 
Then that statement makes more sense, though since most people are used to it as a DBMS, I would make sure to specify that
@KyleHumfeld Do note that for some reason, MS puts MobileService constants in App.xaml.cs
Also that there are very few cases where you need global constants
in fact, with all my WPF/WinStore projects, I've never needed one
thats not to say you won't
but its safe to say its somewhat rare
 
I've got 4 different buttons that push to 3 different pages, and in my VM I want to call the 'GoToAnotherPage' method that's defined in my code-behind. I want to send which page should get pushed to, as a parameter. Since I want to make sure that I never have a problem with accidentally having different strings in the two different spots where I'm using it
(i.e. the calling function and the switch/case in the code-behind function that does the navigating), I thought it a good approach to use a string to identify my target, and a constant to hold that string.
Would you recommend a different approach?
This way seemed natural to me, but I'm definitely up for correction if I'm doing it wrong
(and that's heuristically wrong, because it does technically work, it just might not be a good idea)
 
5:57 PM
okay, apparently I'm an idiot. I've got my object, and I've made a list of objects. Now I want to produce a string made of properties from this object. .Aggregate doesn't work because a string is the wrong return type. Any other linqy ways to do thins coming to mind?
 
@KyleHumfeld I might push an enum instead
@Billdr Could you provide an example?
 
Wouldn't that also be global and/or static? I do like the idea of using an enum, though, I've seen those be quite powerful
 
Enum is a special type
 
If I did that, would I put it somewhere other than a Global.cs file?
 
so yes, its technically "global"
but its not a global variable or anything like that
just a list of values a particular type can hold
 
6:00 PM
Okay, sorry, didn't mean to quibble =)
 
I would put it in a "PageList.cs" file or something
and that file just has your enum
 
Okay, I'll try that, thanks for the recommendation!
 
@Billdr do you want the properties themselves or the values of the properties
 
unmatchedItems.Aggregate((output, next) => output + "\n" + next.PluginId))
 
And which of those isn't a string, and which do you want to be?
 
6:06 PM
Intellisense is barking because unmatchedItems.Aggregate should return a Plugin. I'm asking it to return a string.
 
"cannot convert expression type 'string' to return type 'Portal.Models.Plugin'
 
I see.
Let me refresh my memory on Aggregate
 
@Julien You want dbContext.Categories.Add(new Category(blah)); Er, nevermind. Just noticed you're passing dbcontext in the constuctor. Can we see that code?
 
Could you do this instead:
unmatchedItems.Select(i => i.PluginId).Aggregate((output, next) => output + "\n" + next));
There might be a cleverer way
but that will get you there I think
 
6:09 PM
no, i dont. i want to add a Category to Movie.Categories
i have dbContext.Movies and dbContext.Categories
they are two independent lists
1 movie can have many categories
 
Do you have the many->many set up?
 
@BradleyDotNET Maybe, that'll do it though. I was trying too hard to do it in one pass. Thanks.
 
Category(dbContext)
{
dbContext.Categories.Add(this);
dbContext.SaveChanges();
}
i have existing joins in my db already and it populates fine
 
At the very least, mine is readable
 
Maybe I misunderstood the question Julien. One moment while I reread it.
 
6:12 PM
Oooh, enums are special. It let me name mine 'page' without squawking. Turns out, not a good idea in a WinStore app. =)
 
i edited question. missed some important details apparently
 
Okay Julien. What does this line do? Categories.Add(dvd);
ah, brb.
Alright, so I think of context as a connection string with a limited scope - ie it only has access to certain tables.
Having movies and categories in the same context makes sense, because you'd use them together.
 
when i start my app, i create a dbcontext, and create my view models off of my models
 
What is not clear to me is where you are actually inserting the new Category into it's table.
 
on startup it populates the categories
in the category c'tor
Category(dbContext)
{
dbContext.Categories.Add(this);
dbContext.SaveChanges();
}
so a brand new category will get inserted into the DB master list
 
6:20 PM
I'll assume there's more code than that, since the signatures dont match.
 
yeah it sets some stuff up
thats th eimportant bit
 
So SaveChanges returns an int related to the number of rows it modifies. In that case it should return a 1. See what it gives you.
 
adding to the master lists works
i can see new categories on next startup
 
Hmm. That's weird. No async code in there?
 
that code is pretty close to my real code
no async stuff
 
6:25 PM
I don't know what to tell you man. I have code like that right now that works.
...in the file I have open, actually.
 
how do you have your one to manys set up
 
/// <summary>
/// This is the collection of gems, responses and plugins.
/// </summary>
public class Report
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int ReportId { get; set; }
    public List<Gem> Gems { get; set; }
    public List<Plugin> Plugins { get; set; }
    public List<Response> Responses { get; set; }
    public List<Host> Hosts { get; set; }
}
gotta update that comment.
 
i use OC's, you use Lists
shouldnt matter
 
Nope
on the other end of that....
/// <summary>
/// These are the hosts.
/// </summary>
public class Host
{
    public int HostId { get; set; }
    public List<Plugin> Plugins { get; set; }
    public Report Report { get; set; }
    public List<Gem> Gems { get; set; }
    public string Name { get; set; }
}
 
so you are specifying the relationship on both ends
im not
 
6:28 PM
Oh, yeah... don't let EF guess.
It'll take <className>Id to be the primary key, and beyond that I don't trust it. In fact I usually specify the key and that I want the db to generate them.
 
but not every Category has a movie
 
So a none-to-many. IIRC you can make the foreign property nullable.
 
and a category can belong to several different movies
that cant be right
 
EF doesn't like 1:1. I'm not sure how it feels about 1?:many.
well then you don't have a one to many, do you.
You have a many to many.
 
one movie has many categoriies
that is a one to many
 
6:31 PM
and one category can belong to many movies.
 
i am not defining any relationship from category to movie
but yeah if i was that would be many to many
 
I see what you're saying. I'm not sure what EF will assume when you let it make a decision like that.
 
that is super simple sql. movie_categories table with a movie_id and a category_id
done
 
Is that what it's doing?
It'd need to have 3 columns.
I bet you a dollar it's slapping a movie id column onto the category table.
 
its not, beacuse it works properly on startup
i imported a bunch of data into my table
and it works probably displaying my movies that already have categories
 
6:36 PM
imported through...? EF?
 
json files into EF yeah
 
Can you just look at the db and confirm your three column table exists?
 
how do i look at the db
i have been struggling to figure that out
 
EF, which knows about the mappings it made.
in VS: view->sql server object explorer
 
yeah its not listed
 
6:38 PM
you may have to copy/paste your connection string into the new connection window.
 
i never made a connection string. i just install-package EF and setup db class
 
there's one in your config.
probably something like (LocalDb)\V11.0 for the server.
that's what ASP gives me, any way.
 
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
 
I don't know how to translate that. Is mssqllocaldb a system variable?
I'm tossing that into my server name and it's timing out, but I'm not doing wpf development.
 
i never looked at that until you said its in the config
its all auto generated
 
6:42 PM
1
Q: Entity framework connection string for WPF

user2330678Our application is currently connected to SQL CE but, we have to make it work with both SQL CE and SQL Express. We are using entity framework(model first). And its a windows application. How to write connection string for SQL Server? I found below on msdn site at http://msdn.microsoft.com/en-us...

They list some good guesses for the default server.
 
when i click "connect to server" all it wants is a server name
which is pre-supplied
(localdb)\v11.0
 
so...what I suggested.
 
i already had that
my db is not in there
 
okay, then it's somewhere else.
 
indeed
 
6:45 PM
regardless, the answer is ef is assuming a one to many relationship, and adding a fk to your categories. If you make a many to many explicit in your model it'll do the right thing.
You can find the db on your own time if you'd like to prove it to yourself. :)
 
but it works on load
which means the db is correct
when i load a movie i can see its categories
dbContext.Movies.Include("Categories")
works fine, populates my OC<Categories> inside Movie
you might be right that EF is assuming something on the save
but the db structure is good
 
Heading home. Need to do a bunch of bike riding. Thanks for the help @BradleyDotNET.
 
7:15 PM
see you later
 
i fucking got it
 
8:16 PM
you're awesome
 
I KNOW RIGHT
 
@Julien blog post about paging here dynamic-data.org/2015/04/22/… I hope to illustrate MergeMany and several other operators in the next few days
 
sorry i made that sound boring haha, but i was actually being serious!
 
8:33 PM
@RolandPheasant thanks ill take a look sometime soon
@NETscape took FOREVER
 
i was debating whether I should tell you or not
 
8:46 PM
lol
 
9:10 PM
Word of warning, if you use Awesomium, it leaks
and if you are displaying GIFs, it floods*
 
wat
how are you using it?
C#?
ahh i see
 
Hi guys! Things are moving right along, thanks to your help! =)
Obviously, that's a prelude to a new question =)
My calculator has dozens of buttons, and because this is a port of an existing app, we have a very specific set visual requirements
So we can't use the default thick-border, big-padding buttons that's common on WinPhone
I figured out how to do some of the styling I need, namely getting rid of the border and setting the background color of the buttons
But there seems to be an internal padding on them that I can't clear out. it's really big and makes the buttons spill out from the cells in their Grid
 
use control template to completely style an element
 
Is Button the wrong thing to be using here? I have no problem using, say TextBlocks
I'll look that up. Thanks!
 
i do it for buttons quite often
 
9:23 PM
I've seen vague mention of control templates before, but haven't looked at it in depth
 
you just build a xaml structure and it behaves likea button
for eg a plain old textblock
 
Buttons is right
but yeah, rewrite the control template
You get commands with buttons, which would be difficult with textblocks
so I wouldn't go that route
 
Right, that's why I was hesitant - there's a lot of good baked-in functionality with the buttons, and I don't want to have to reinvent that wheel =)
Am I correct in assuming that the {TemplateBinding [stuff]} in : Background="{TemplateBinding Background}"
 
i meant make the control template of your button a textblock
sorry
 
says 'grab whatever the element using this template has for the [stuff] property, and put that here'
Right, okay, I'm with you on that. I was considering swapping out my buttons for textBlocks. I do that a lot on web apps, where I don't use <a> tags for stuff that's clickable but just fires JS functions. Instead, I use styled <span>s, which doesn't have the unwanted default functionality of <a> tags. So this is similar to that, only I want the functionality but not the look of <Button>s
 
9:38 PM
keep it as a button
thats what control template is for
 
Okay, am I correct in my inference of the {TemplateBinding} bit above?
 
Never used TemplateBinding
 
ive never used template binding
 
so I'm not sure tbh
 
I also saw '<ContentPresenter>' in one of the examples, but I'm not sure yet what that does
 
9:41 PM
its essentially a placeholder
you can put whatever you want in it
 
ContentPresenter is where the "Content" property gets stuffed into
 
Okay, how do you get your template to know where to put the Content of your button, or example
Aaah
Looks like {TemplateBinding Content} does that too, which is interesting
So would I put that ContentPresenter in the TextBlock? Is that the idea?
Instead of putting a Text property on it, that is
 
the textblock is the content of the contentprsenter
 
Aaah, so the ContentPresenter is the first and only child of the ControlTemplate
And everything else goes inside that
Is that correct?
 
its the GUI bit
 
9:43 PM
Right, sorry there's a Theme part and a Function(?) part that I saw mentioned
Okay, cool, thanks for the pointers, I'll head back and try some experimentation
 
Well, in your case
 
<Button>
<Button.Template>
<ControlTemplate>
<fa:ImageAwesome HorizontalAlignment="Center" VerticalAlignment="Center" Icon="Times" Foreground="Red" />
</ControlTemplate>
</Button.Template>
</Button>
 
but the ContentPresenter could be in a border
like in a standard button
 
the button is now a font awesome image
highly recommend font awesome btw
 
What is font awesome? Something out there in internetland that I can search for?
 
9:45 PM
icon image pack
nuget-able
 
@Julien I get the feeling you really like third-party stuff :)
 
why write your own
steal
 
Because other peoples s*** almost never works right :(
 
lol thats the struggle
 
and by the time I get it working, I could have written it myself
 
9:47 PM
these things i use would take me years
theres no way
 
For someone like me, it's sometimes helpful to see others' syntax, since there's a whole iceberg that I don't know and only a tip that I do
 
and my stuff works the way I want it to, so I just start by writing my own :)
 
i am working on a new thing
maybe in a month or two i will have something to show
 
When I'm a ninja at a language, I definitely write my own stuff. When not, well, I don't. =) And I do like using good 3rd party stuff like jQuery. No way I'd write that on my own.
The hard part there is finding good 3rd party stuff that's well-enough documented to actually be usable and useful
(and isn't full of bugs)
 
wpf has great 3rd party stuff in my opinion
i also just think wpf is great
 
9:49 PM
WPF is great, and it does have some useful 3rd party
but not that much, at least that I have found/needed
but yeah, I'm not writing jQuery either :)
 
Okay, being a nuget n00b, do I have to do Get-Package font awesome, and then Install-Package font awesome, or just the latter, or do I have the package name wrong?
 
just install
 
I assume you have to install to VS with the command line
 
theres a gui
but i prefer cmd
 
what's the package name?
font-aweome?
 
9:52 PM
you can usually just google nuget "whatever" and it'll find the nuget page
 
aha, thanks
again, nuget n00b
Is there a way for me to add a Win8 project to my (hopefully) universal app when I already have a Shared?
This is more for @BradleyDotNET
I accidentally wiped out some kind of file in the directory that allowed it to be loaded, so I've pretty much got to start that Project in the solution over
 
Never tried it
Since I always started universal
but probably
I'd just add a new win8 project and try adding shared as a reference
 
I know I can do it if I only have Phone and no BigWin or Shared
But I have Shared... which is giving me issues
 
Add support for Windows or Windows Phone
If you've already published a Windows Store app, it’s easy to reuse some of the code and publish a version of your app for Windows Phone. Similarly, if you started by creating a Windows Phone app, you can modify your solution to build for Windows tablets and desktops as well. To add support for one type of device or another, in Solution Explorer, right-click on the project and choose Add Windows Phone 8.1 or Add Windows 8.1.
 
06:00 - 22:0022:00 - 00:00

« first day (915 days earlier)      last day (3234 days later) »