|
I'd just use the SplashScreen that was introduced in 3.5 SP1. Here's[^] more information.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
It seems that the WPF ListView expands when the content height increases, but it does not contract when the content height decreases. Here is a simple example that demonstrates the issue:
<Window x:Class="TestShrinkListView.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Border BorderThickness="2" BorderBrush="Red" VerticalAlignment="Top">
<ListView Height="Auto" VerticalAlignment="Top">
<ListViewItem>
<TextBox AcceptsReturn="True">Type some text here.</TextBox>
</ListViewItem>
</ListView>
</Border>
</Window>
If you run that and press ENTER a few times, you'll make the TextBox increase it's height, and the ListView will expand to accommodate the new height. However, if you delete a few lines from the TextBox, the ListView remains at the same enlarged height.
Is there an easy way to make the ListView decrease its height when the content shrinks (e.g., a height property), or am I going to have to get clever with some special coding?
If I have to get clever, one thing I did notice is that removing a ListViewItem from the ListView causes the ListView to contract to the proper size. I suppose I could look into how that exactly happens, but I would really prefer a cleaner solution.
If you have any ideas, please run them by me. I'd love to hear your opinion. Thanks!
Visual Studio is an excellent GUIIDE.
|
|
|
|
|
I have today off, but after a full night's sleep, my mind is less clouded than it was yesterday when I ran out of programmer-fu. The problem we ran into yesterday is now bugging me to find a resolution.
We have a web service on an internal IIS server that is not on the company domain. This server has a number of WCF web services running on it so we can test our client application.
The endpoint defined in the application's app.config uses the server's IP address in the URL. However, when we try to connect via the application to the web service, the IP is changed (internally) to the machines name.
Does anybody know why it does it that?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Friday, September 4, 2009 9:48 AM
|
|
|
|
|
John Simmons / outlaw programmer wrote: WCF
there's your problem.
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel] | FoldWithUs! | sighist
|
|
|
|
|
Yeah, that's one of the many "difficulties" we face. We're writing the application from hell:
- WPF
- WCF
- nHibernate
- RDB
As you can see, the further you get down the list, the more likely it is that you will exclaim, "WTF!?".
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: As you can see, the further you get down the list, the more likely it is that you will exclaim, "WTF!?".
So, let me guess. At the end of the list, there should be InstallShield - that you're using to create setup?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
No, the install shield part has been outsourced to another country; communication with them is done using Lotus Notes.
And on the top of it, John forgot to mention the legacy VB6 library used in a part of his code that has also to be maintained.
|
|
|
|
|
Thank god nobody has suggested that yet...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
2nd from the bottom - Crystal Reports.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That's the problem with big frameworks. You get them to work but most of the times you don't fully understand why and how they are working. This produces, in the best scenario, a slow application, in the worst an application with many subtle reliability defects.
|
|
|
|
|
John Simmons / outlaw programmer wrote: the further you get down the list, the more likely it is that you will exclaim, "WTF!?".
Except in this case the "W" stands for "Why"
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Have you printed out the death march t-shirts yet? Gack, sounds awful!
|
|
|
|
|
*cough* technology guinea pigs *cough*
Our thoughts are with you.
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel] | FoldWithUs! | sighist
|
|
|
|
|
Hi
I have a rather simple question. If I declare a ModelVisual3D as a resource in XAML, how can I use this resource in multiple places without getting the error " Specified Visual is already a child of another Visual or the root of a CompositionTarget" ?
|
|
|
|
|
In your resource file, use the Shared attribute so your resource gets cloned each time you use it.
For example:
<ModelVisual3D x:Shared="False" ...>
...
</ModelVisual3D>
|
|
|
|
|
I can't access this attribute at all?? I tried "Shared, x:Shared, isShared" and none of them exist. Do I have to reference something specific first?
|
|
|
|
|
This only works if your item is defined in a ResourceDictionary.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Make sure you have referenced this namespace:
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
Okay thanks I got it working.
For some or other reason x:Shared doesn't show up in intellisense, but it still works.
|
|
|
|
|
Hi,
I am trying to implement upload images to database by using a WCF service.First I placed a opendialogbox in the silverlight page and I am planning to to pass the file path to the WCF service and there I will convert it to binary format and save it in the database. Here my problem is, I am unable to get the openfile dialog file complete path due to security reason in silver light and in WCF service I an not even getting open dialog control.
If anyone have idea to get the complete path of the selected file in open file dialog please reply me.
Thanks in advance.
|
|
|
|
|
You can't get the complete path because this would represent a security hole in the system. It's the same reason that you don't get the path in the standard file upload component in ASP.NET. By giving access to this, you could present a malicious author with knowledge about your file system.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Read file as stream from openFileDialog.File from the client and send it to the WCF Service.From the WCF Service write the stream in server and save that path in database.
|
|
|
|
|
Hi,
I developed a Usercontrol which has a slidercontrol and the textbox displaying the current slider value.
I need to adjust only the slider width from the widow XAML that uses the Usercontrol . Can anyone let me know how to achieve this.
Thanks
|
|
|
|
|
Hi...
An example in the Codeproject has this implementation.
I am extracting from it and pasting it here.
in XAML.cs,
<pre> private void CenteringSlider_LostMouseCapture(object sender, MouseEventArgs e)
{
// change the size of the ellipse when slider value is change
// for this example the slider max is 80
// and the slider min is -80
PlumEllipse.Width = PlumEllipse.Height = (100 + e.NewValue);
}
private void CenteringSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
// set a 500ms duration
Duration returnToCenterDuration = new Duration(new TimeSpan(0, 0, 0, 0, 500));
CenteringSlider.BeginAnimation(Slider.ValueProperty,
new DoubleAnimation(CenteringSlider.Value, 0, returnToCenterDuration, FillBehavior.Stop));
// set the slider value to zero
// otherwise the slider will return to the last postion after the animation
CenteringSlider.Value = 0;
}
</pre>
Please search for the full project in codeproject itself.
Thank you,
Ramm
|
|
|
|
|
Assuming you have exposed a property in your usercontrol for the width, all you need to do in the control itself is add Width="{Binding MyWidthProperty}" in the XAML for the slider. Then, the hosting item just sets MyWidthProperty="nnn" (where nnn is the width you want).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|