|
Can you provide a little more detail in your question. I am not sure what you are asking.
|
|
|
|
|
i think you can use anchor.
|
|
|
|
|
Could you elaborate on how Anchor can be used.
|
|
|
|
|
hi,
I want to deploy me wpf application done in C#. for this i have used clickonce, my application uses 'n' number of dlls which i have added to the project and then i get them on my client machine once say install.. my problem is that the application also has folder structure in which some xml file resides, i am not able to add this folder in my setup.. can any one suggest me a way achieve this!!
Thanks in Advance
Samir
|
|
|
|
|
Hi
I am VERY new to Silverlight and I am currently developing my first Silverlight Application. I have a bunch of mp3s located in my ASP.Net web app at "~/music/". And I have XAML as:-
<MediaElement x:Name="meAudioPlayer" AutoPlay="False" Source="music/test.mp3"></MediaElement>
But the mp3 doesn't play. If I copy the mp3 to "~/ClientBin/music/test.mp3" it works! But I can't copy ALL mp3s to the ClientBin folder. My web app has 1000s of mp3s located in the "~/music/" folder instead. The MSDN documentaton says that I can use Javascript APIs to set the source relative to the calling HTML page. But it doesn't have any example code. Could someone please show me how to do this?
Thanks!
|
|
|
|
|
I think it's because of wrong path... you need to go like ../music/test.mp3. or try to get full path from server-side playlist..
|
|
|
|
|
Now that you have been using WPF for a while, look back and tell me what your 'ah-ha' moment was...
Usually we have one defining point where all the pistons start firing and all the lights come on that opens up a whole new world for us. What was yours with regards to this technology?
|
|
|
|
|
Well - this[^] article describes mine. However, talking to Josh, Sacha, Dr WPF and Karl's been good for lots and lots of "oh wow" moments.
|
|
|
|
|
Not sure ALL the pistons are firing yet!
I liked this article on how a humble listbox can be completely changed in appearance.
http://bea.stollnitz.com/blog/?p=40[^]
Then going back a few weeks later and understanding (most of) the code this time.
Also as Pete said lots of good WPF authors here on CP.
Same thing, might not quite understand them, but let them sink in and they make more sense on rereading.
Another thing was understanding that XAML is not some mysterious language but you can do things like just make an arraylist with integers and bind it to a listbox, very easily when you know how.
The Pro WPF book has a nice chapter on this at the start. (You might be able to find this on google books, if you don't have a copy)
<window.resources>
<sys2:arraylist x:key="myArrayList" xmlns:x="#unknown" xmlns:sys2="#unknown">
<sys:int32 xmlns:sys="#unknown">1
<sys:int32>2
<sys:int32>3
</sys:int32></sys:int32></sys:int32></sys2:arraylist>
</window.resources>
<listbox itemssource="{StaticResource myArrayList" />
Then once you learn all that WPF stuff, you goto Silverlight and find out half of the good stuff is missing. *sob*
|
|
|
|
|
When I realized updating/expanding my old MFC-based UI code was taking way to
much time and I thought "hmm....I'll take a look at WPF...".
I have Silverlight/WPF ah=ha moments several times a day...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ooh, another one.
I was looking at my first attempt at a WPF app, and I was thinking "Who wrote this crap? It's all done wrong!"
Stuff like updating text on controls via a loop instead of just using databinding.
|
|
|
|
|
There have been many! And many followed by a ... "oh ... I didn't expect that" but mostly "doh!", "FECK" & "Blurgh!!"
|
|
|
|
|
Hi Everyone
Im trying to do an auto complete text box control that it binded to sql .. so that when a user types in something like lets say in the database i have a table called building and in the building table i have columns like Building ID & Building Name and that will be binded to the textbox so that when i type in Micr it will give me a drop down of all the stuff i have in the database that start with "Micr". Does any one know how do to do this.. An example or idea will be very helpfull.. Thanks in advance ...
|
|
|
|
|
|
I am really hoping someone here can help me. I've been playing around with the WPF DataGrid and am having a weird problem. What I have is a TabControl with two tabs. Each tab has a DataGrid with two columns. The first column Width is "Auto" and the second column Width is "*" which should fill the remaining space in the Datagrid. What is happening is that the DataGrid in the first tab's columns are sized appropriately, but the second tab's second column is wider than it should be. Also, if I change the SelectedIndex to the second tab, it's columns are size correctly but the first tab's columns aren't. I have tried to Invalidate the DataGrid control when the selected tab changes but that didn't seem to do anything. I'm not sure how to explain this better but here is some example XAML:
<TabControl TabStripPlacement="Left"
Margin="0,0,0,0"
Background="White" Padding="0,-10,0,0"
SelectedIndex="0"
Grid.Row="1"
x:Name="TabEdit">
<TabItem Header="Tab 1">
<tk:DataGrid
AutoGenerateColumns="False"
ItemsSource="{Binding Path=Properties}"
>
<tk:DataGrid.Columns>
<tk:DataGridTextColumn
Width="Auto"
IsReadOnly="True"
Header="Property"
Binding="{Binding DisplayName}"
/>
<tk:DataGridTextColumn
Width="*"
IsReadOnly="False"
Header="Value"
Binding="{Binding AggValue, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
/>
</tk:DataGrid.Columns>
</tk:DataGrid>
</TabItem>
<TabItem Header="Tab 2">
<tk:DataGrid
AutoGenerateColumns="False"
ItemsSource="{Binding Path=Properties}"
>
<tk:DataGrid.Columns>
<tk:DataGridTextColumn
Width="Auto"
IsReadOnly="True"
Header="Property"
Binding="{Binding DisplayName}"/>
<tk:DataGridTextColumn
Width="*"
IsReadOnly="False"
Header="Value"
Binding="{Binding AggValue, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
/>
</tk:DataGrid.Columns>
</tk:DataGrid>
</TabItem>
</TabControl>
If this is not enough information, I'd be happy to answer questions.
Thanks for reading!
P.S. Sorry if the code is hard to read. I couldn't get it to work in a code block (<pre></pre>)
|
|
|
|
|
|
Great! Thanks for trying it. I'm glad it's not something really obvious that I missed at least.
|
|
|
|
|
I didn't dig into the DataGrid source code, but this workaround seems to work...
I added a SelectionChanged handler to the tab control:
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
System.Collections.IEnumerable olditemssource = datagrid2.ItemsSource;
datagrid2.ItemsSource = null;
datagrid2.ItemsSource = olditemssource;
}
Resetting the ItemsSource on the DataGrid is the only way (I could figure out) to get
the DataGrid to re-layout its columns correctly.
That's not really a good fix though, since if the user changes the column sort order,
it won't be preserved if the tab is navigated away from and back to.
They key point is to NOT set the ItemsSource until the DataGrid's associated tab is
navigated to for the first time. I'll leave that as an exercise for you
I'm thinking this should probably be reported as a bug on the toolkit CodePlex site...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
aalex675 wrote: I think this may already be in the bug tracker on CodePlex as issue #8842
Cool! I didn't find it when I looked. Thanks!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I,
I'm trying to extend the Standard WPF Label control in order to be able to change it's font (underline it) if a particular condition is true.
The font change will occur in the OnItialized method like this:
protected override void OnInitialized(EventArgs e)
{
if (conditionTrue)
{
//TODO Underline it
}
base.OnInitialized(e);
}
What code should I use to underline it?
Thanks
Paolo
|
|
|
|
|
You could always use a variant of the sample I posted here[^].
|
|
|
|
|
In addition to the XAML, you can also do this:
MyTextBlock.TextDecorations = TextDecorations.Underline;
To undo the underline:
MyTextBlock.TextDecorations = null;
Hope that helps.
Blitz
|
|
|
|
|
While you can do this, one of the interesting things about applying triggers in XAML, is that (as soon as the trigger condition no longer applies), the default style is reverted to.
|
|
|
|
|
Thanks; that's good to know. Doing it in XAML, then, makes it unnecessary to set it back to the default style. I thought about doing that - but just didn't know how to do so. I am such a Blend addict
|
|
|
|