|
Microsoft claimes that SketFlow is used to give the Develoer a jump start by allowing the designers rendenditon to be ported into a new project and generate a new solution based on the exact specifications of the protottype. I would like to write an article seriexe on this, I have been lkeeping my eye oen for a while now, bot have not found any information that walks you throught the end-toend process.
@ProtoBytes
"'I'm in alpha testing acceptance of IE9, so far so good. Like it better then chrome!', watched ScottGu's Win7 Phone on channel9 in HTML5, you could see the detail in his 5 PM shadow very nice work MS!
|
|
|
|
|
This was easy to do in 3.5 and 3.5-SP2. and also easy to accomplish using GDI. However I need GPU acceleration on the Client of a Sliver Light Application I'm writing and need to generate a Writable Bit Map Image on the fly using GPU hard ware acceleration. I have tried this in both WPF and Silverlight, and found the documentation code doesn't even work that MSDN has on display. ScottGu made a small post about it, but I was not able to find a reference to the APIs he mentioned.
This is a heave weight scientific mathematical graphical animation sequence, much like creating a Mandelbrot space auto explorer, however it has real scientific and mathematical value as a tool, not eye-candy. It also needs to use the Share language to perform some Hardware manipulations of the images. The images are based completely off of dwrights work on complex color maps: Visualizing Complex Functions I am in the process of porting the Meta Numeric library to CUDA, and also trying to port dwrights code for this demo to SIlverlight and WPF as my project uses his work, and leverages some other interesting features, full explanation here:
ProtoBytes@msdn.microsoft.com - Monads Blog Entries
@ProtoBytes
|
|
|
|
|
I have using the designer to create XAML images from other images using the Image Auto Trace tool. This works find, but when I try to apply an effect, it locks up. I'm running a AMD 965 8 GB. Memory DDR3 1333 CL9 50ns. w/ Nvidia GeForce 460 GPU. Last time I ran Studio, I recall it was using the GUP, now I get 100% CPU usage when I attempt to do the same type of rendering on my Vector images. They can be quite large, but don't max out my 8 GB. of memory, and the Video chairs 4Gb. of the memory, so there is plenty of video memory.
Anyone know how to get the Expression suite o use more of the GPU and less of the Processor, and yes I'm OC'ing at 3.8 GHz. (Completely stable at 57 degrees C)
@ProtoBytes
|
|
|
|
|
Where is the best place get get information on how to take a user control; like one downloaded from the Sliverlight Gallery, and add it to an exsisting project, or better yet create a completly new user control libabrary of all controls with a user control test suite project as part of the solution to bother verify the code works and the page load doens't hang, UI thread lock etc.
I recently downloaded the example code for the 'Binary Clock' on the Silver Light Gallery and modified teh animation so the dots changed colr based on the binary bit they were in. The control works just fin in blend 4 and runs smoothly, however when I load my page I get the blue sliverlight spinning gizmo and no page load.
So I attempted to just add the usercromtrol directly to the project instead of suing it as an asset from another project in the solution. no go!
Then I create a user control libabary, and got distracted, when I found MEF 2 Preview and patched it by lazy signing each class at build time, to demonstate in an article.
@ProtoBytes
|
|
|
|
|
Hi all,
I want to make a master detail screen. Get master and detail data from WCF service.
Dataform should get validation, error message etc.. from the class. but I can't get metadata from the WCF.
I try to Domain Service Class in WCF but I can't create context with Linq.
How can i use dataform with WCF. please help
S.A.A
|
|
|
|
|
|
Hello im new to Silverlight and i'm having a problem with consuming a WCF service. i have created a Currentname.cs that i use for databinding.
And news.cs where i store the data
The problem is when i call the service the it doesn't trigger the "event"
and populate the propery
Could anyone help?
<br />
<br />
private ObservableCollection<News> _PrivateNews;<br />
public ObservableCollection<News> _News <br />
{<br />
get<br />
{<br />
if (_PrivateNews.Count == 0)<br />
{<br />
getData();<br />
}<br />
return _PrivateNews;<br />
}<br />
set<br />
{<br />
_PrivateNews = value;<br />
if (PropertyChanged != null)<br />
PropertyChanged(this, new PropertyChangedEventArgs("News"));<br />
}<br />
}<br />
<br />
public void getData()<br />
{<br />
ServiceReference1.Service1Client newservice = new ServiceReference1.Service1Client();<br />
newservice.GetNewsCompleted += new EventHandler<ServiceReference1.GetNewsCompletedEventArgs>(newservice_GetNewsCompleted);<br />
newservice.GetNewsAsync();<br />
}<br />
<br />
void newservice_GetNewsCompleted(object sender, ServiceReference1.GetNewsCompletedEventArgs e)<br />
{<br />
<br />
ObservableCollection<News> myNews = new ObservableCollection<News>();<br />
foreach (ServiceReference1.P_GetSomeNewsResult x in e.Result)<br />
{<br />
News n = new News();<br />
n.Header = x.NewsHeader;<br />
n.Content = x.News;<br />
myNews.Add(n);<br />
}<br />
_News = myNews;<br />
}<br />
modified on Friday, October 22, 2010 8:56 AM
|
|
|
|
|
Looks like you are firing a property change for "News", but your property is called "_News".
|
|
|
|
|
Thanks, the binding works great now
|
|
|
|
|
I should source code for example to new project me it's about Assign Datagrid Value From Child Web Page To A Textbox In Parent Webform by silverlight. I don't know,How to write source code?..
|
|
|
|
|
I am having an issue with editing my data in a row details template. Has anyone experienced this issue? Here is some of the XAML:
<DataGrid
ItemsSource="{Binding AllInspections}"
AutoGenerateColumns="False"
Grid.Row="4"
Margin="5,0,0,0"
SelectedItem="{Binding SelectedInspection}">
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<TextBox
Text="{Binding Notes, Mode=TwoWay}" />
</DataTemplate>
</DataGrid.RowDetailsTemplate>
Save code is simple datacontext.SaveChanges()
The Binding Notes is displaying the information, but I can't get it to save and update. Nor anything I put into Row Details. When I include the field in the datagrid as a text box row it works fine. Thoughts?
P.S. After testing I see that the associated item (SelectedInspection) is not being updated nor is the observablecollection AllInspections. So putting the "Save" and datacontext updating aside, it looks like I cannot update the observablecollection from my rowdetails.
Cheers, --EA
P.P.S After messing around with this enough I ended up changing the binding of the textbox to:
Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}},Path=SelectedItem.Notes}" />
So I suspect the issue has something to do with the "SelectedItem" of the datagrid not being available to the RowDetailsTemplate. I am not sure why this would result in being able to display the data using {Binding Notes} and not edit it, but c'est la vie. If anyone has insight about this, I would appreciate it.
modified on Friday, October 22, 2010 5:06 PM
|
|
|
|
|
I am new to WPF, so bear with him.
I want to have a GridView with 2 columns, displaying custom controls, which has X amount of rows.
The data i am given is in a list format, which i then need to display as follows: i want to insert item 1 in column 1 and item 2 in column 2 for row 1. And then item 3 in column 1 and item 4 in column 2 for row 2, and so on - (Think of it a bit like a photo gallery)
The custom control will display the details for each item, which i have already created.
The problem i have is, how do i bind the data to the GridView.
My initial idea was to split the data into rows, i.e.: have several lists, that contain 2 items. This allows me to know that item 1 is for column 1 and item 2 is for column 2, i can then work my way through all the lists and end up with all the rows populated with the custom controls.
However, i cant work out how to programmtically add a new row, which should have a control in each column.
Am i going about it the right way? Or barking up the wrong tree...
Hopefully i've made sense.
Cheers.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I've changed my idea to have to have 2 stack panels, as this seems more fitting.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Solved.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I developed some userControl that contain some information check on the 'IsVisible' method ( override method ).
When i using this usercontrol on some window - i see some error because the 'IsVisible' method look for some variable that is set on run-time.
How can i check if I'm in design time and the system is not running ?
Thanks for the help.
|
|
|
|
|
|
hello,
I'm buzzy to create a custom listview witch has custom defined views based on the data it gets. I like
views with links such described in the example below and for example with a textbox and a textblock,
but it doesn't matter how it goes about it's idea.
I have a enum like this to know witch datatemplate must be used:
public enum tabType
{
tabbedTextBlock = 1,
tabbedLinkedBlock = 2
}
This class is a class to store data in
public class person
{
private string firstName;
private string lastName;
private int age;
private tabType type;
public person()
{
}
public person(string firstName, string lastName, int age, tabType type)
{
this.FirstName = firstName;
this.LastName = lastName;
this.Age = age;
this.tabType = type;
}
public string FirstName
{
get;
set;
}
public string LastName
{
get;
set;
}
public int Age
{
get;
set;
}
public tabType tabType
{
get;
set;
}
a list of objects too be bind to the list
public class sampledata : ObservableCollection<person>
{
public sampledata() :base()
{
Add(new person("foo", "fofoo", 23, tabType.tabbedLinkedBlock));
Add(new person("apple", "fruit", 21, tabType.tabbedTextBlock));
Add(new person("pineapple", "fruit", 17, tabType.tabbedLinkedBlock));
Add(new person("banan", "fruit", 47, tabType.tabbedLinkedBlock));
Add(new person("kiwi", "fruit", 34, tabType.tabbedTextBlock));
}
}
the tabtype is used to let the custom listview class know witch type of datatemplate most be used.
I have searched for a view day's but couldn't found a nice working solution, only an idea but
it's written in VB.net with windows forms. It can be found here.
thx,
DJohn
|
|
|
|
|
I define some new button style.
The style default background is image X.bmp and when on 'mouseOver' is true the image is changing to Y.bmp
I have 10 buttons on the code that need to use this style - and each of the button need to show different image as default different image on 'mouseOver' event.
I can set the bitmap on each button on the button constructor - but i don't know how to set the image in this case on the style definition level.
Someone can help here ?
|
|
|
|
|
|
Hi,
I have a combo box and keyboard shortcut to it. When I use keyboard shortcut to access this combo box, focus is moving combo box but its items are not moving up/down with the help of arrow keys..
Following is my xaml..
<Label Content="Security _Level:" VerticalAlignment="Center" Target="{Binding ElementName=securityLevelCombo}" />
<ComboBox Grid.Column="1" x:Name="securityLevelCombo" Margin="8,0,0,0" IsReadOnly="True" VerticalAlignment="Center" SelectionChanged="securityLevelCombo_SelectionChanged"/>
Please help..
Thanks
|
|
|
|
|
Am I missing something here?
I wrote the usual "viewmodel locator":
public class ViewModelBase
{
public static readonly DependencyProperty ViewModelProperty = DependencyProperty.RegisterAttached("ViewModel",
typeof(System.Type), typeof(Window), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnViewModelChanged)));
public static void OnViewModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
d.SetValue(Window.DataContextProperty, Activator.CreateInstance((Type)e.NewValue));
}
public static void SetViewModel(DependencyObject d, Type value)
{
d.SetValue(ViewModelProperty, value);
}
public static Type GetViewModel(DependencyObject d)
{
return (Type)d.GetValue(ViewModelProperty);
}
}
Then I implemented a viewmodel like this:
public class Class1 : ViewModelBase
{
public String Test
{
get
{
System.Windows.MessageBox.Show("4");
return "Testing";
}
}
public List<String> Items
{
get
{
List<String> l = new List<String>();
l.Add("A");
l.Add("B");
return l;
}
}
}
then in my mainwindow.xaml, I just did:
local:ViewModelBase.ViewModel="{x:Type local:Class1}"
<TextBlock Background="Red" Text="{Binding Test}" Height="30" />
<ListBox Background="Green" ItemsSource="{Binding Items}" Height="100" />
works fine at runtime, but no data is shown at design time. I put a message box in OnViewModelChanged() and it does get called.
what do I need to do to see the bindings work at design time? I should point out I am using Visual Studio 2010.
|
|
|
|
|
Hmmm... I've found the whole d:DataContext="{d:DesignInstance Type=local:Class1}" thing... but it seems pretty flakey. If I paste it in, it might show the design time data once or twice, but when I rebuild, its gone again. Is there a way to set that automatically when I create the instance in OnViewModelChanged?
Not that it matters lol, since it doesn't work most of the time.
Any other ideas?
|
|
|
|
|
Say I have a dialog with a list box and 3 buttons: Add, Edit and Delete. The listbox displays a list of Widget objects.
I'm assuming the "proper MVVM way" is to do something like:
class ViewModel
{
public ObservableCollection<widget> Widgets { ... };
public Command AddCommand { ... };
public Command EditCommand { ... };
public Command DeleteCommand { ... };
}
Add then the ListBox.ItemsSource binds to Widgets, the Add button to AddCommand, Edit to EditCommand and so on...
Now is where I get confused on MVVM...
1) Typical Add button behavior is to auto select the new item. How would that happen? It was suggested to me that ViewModel expose a "CurrentItem" property for **2-way** data binding with the listbox. The AddCommand handler would update the CurrentItem after it creates it. Is this a good idea? To me, that seems hokey as it would force that behavior on everybody using the view model. Also, it would set that property in situations where it may not want to be set. Any ideas?
2) Obviously, Edit and Delete need to be disabled if no item is selected. I know how to do that the "non MVVM" way, but what is the MVVM way? I know the command has a CanExecute handler. Should all that logic happen in there? It would seem I would either need the list box or the selected item and the collection.
I guess I'm just trying to figure out where the line should be drawn at which code goes in the code behind and which goes in the view model.
I understand MVVM "purists" say ZERO code in the code behind, but it seems to me like you'll be creating a lot of properties, commands, etc and jumping through a lot of hoops to have all the bindable properties in the view model.
|
|
|
|
|
1) If there are certain situations you dont want the command to execute, the command should have a CanExecute property which can be set.
2) You achieve this through binding the enabled property of the command button to a property in your view model. This property should implement INotifyPropertyChanged . This property is then set to false triggering an INotify which will disable the button.
Hope this makes sesnse.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
modified on Monday, October 18, 2010 3:01 AM
|
|
|
|
|
We have implemented an observable list, a selected item and an editable item. The editable item is used as a throw away object to support the user cancelling an edit.
I also find I refresh a list from the database after a CRUD operation on one of the items. Getting all the related data for a complex item is a pita. Say if you add a chair and want the room, apartment, floor, building information on the chair object (as with a view) then getting all those items is tedious. Although I may be doing this quite wrong!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|