Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all 1760 articles
Browse latest View live

New Post: Show BusyIndicator with IResult and Coroutines

$
0
0
Late reply, but if anyone stumbled across this post for similar reasons, I found that I had to replace this line
var view = context.View as FrameworkElement;
as
var view = context.Source as FrameworkElement;
Note: i am using the Xceed busy indicator and not the WPFToolkit one, but the principal is the same.

I have also refactored my code to not be var view, but var source.

New Post: Conventions not working inside Hub

$
0
0
I am experimenting the same problem. Did you receive an answer somewhere? Is it a bug or There is a workaround other than using the explicit micro:Message.Attach?

Let me know
Enzo Contini

New Post: Conventions not working inside Hub

$
0
0
Hi,
Unfortunately nobody gave me any explanation or a solution.
So, in my application I use the explicit form caliburn:Message.Attach.
As far as I know, for now it's the only way

New Post: Conventions not working inside Hub

$
0
0
Thank you.

I will do the same :-/

Reviewed: Caliburn.Micro v1.5.2 (11月 25, 2014)

$
0
0
Rated 5 Stars (out of 5) - i want to try this

New Post: Caliburn-Windows OS compatibility

$
0
0
Hi,

Can I create an application using Caliburn that would be compatible with Windows7, Windows 8.1 and later Windows OS versions in future, I mean without having different copies of my application for different OS versions. If so, then what dlls am I supposed to reference? If not, then how can I achieve writing a single application to be used in Win7, 8.1 and later versions.

New Post: Recommended strategies for custom View location

$
0
0
Hello,

I've got a ViewModel that is somewhat customized and which breaks the conventional mold locating Views.

In the views, I work through a couple of data templates and a data template selector in order to connect the dots, but this is outside the built-in CM view locator conventions.

That I've been able to determine, I can apparently implement IViewAware on my ViewModel to handle this concern. Magically the view appears, and apparently all I needed to do was "implement" the GetView method. Effectively I am returning null as the corresponding AttachView never seems to be called.

I've checked, and the connection does seem to be legit, but for the fact I've got an AttachView hanging out there without an implementation: i.e. throws NotImplementedException. 'Legit', that is to say communication to/from the ViewModel does happen.

So, with that background in mind, how is it that I am actually telling the locator which view(s) to use through IViewAware? Are there any examples of this sort of thing, i.e. customizing the view location and/or with data templates?

Here I am also wondering whether I need to implement a custom ViewLocator handler during my module bootstrap sequence.

Thank you...

New Post: Recommended strategies for custom View location

$
0
0
Turns out this was a Module source control snafu. I reverted the module, where I was replacing the view model resolution strategies, and now AttachView is fact happening first. It is happening for a default TextBlock, which seems odd, so likely I need to intervene during the view location strategy after all for certain types of view models.

New Post: Handling Focus?

$
0
0
I want give a little contributing for this FocusBehavior class.

For "TwoWay" binding mode be the default mode, it's need a FrameworkPropertyMetadata on DependencyProperty Register method.

See the sample:
public static readonly DependencyProperty IsFocusedProperty =
            DependencyProperty.Register(
                "IsFocused",
                typeof(bool),
                typeof(FocusBehavior),
                new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (d, e) => { if ((bool)e.NewValue) ((FocusBehavior)d).AssociatedObject.Focus(); }));
Regards,

Anderson Correia.

New Post: Caliburn.Micro for Windows Forms and Visual WebGUI

New Post: Rearranging activation order

$
0
0
During my override of OnActivate(), I need to call GetView() in order to focus an element. When I do this after I have previously activated my view, it's fine. But when I call this the first activation, it fails.

I was able to get it to work by swapping a few lines in ConductorBaseWithActiveItem<T>.ChangeActiveItem. The original is as follows:
        protected virtual void ChangeActiveItem(T newItem, bool closePrevious) {
            ScreenExtensions.TryDeactivate(activeItem, closePrevious);

            newItem = EnsureItem(newItem);

            if(IsActive)
                ScreenExtensions.TryActivate(newItem);

            activeItem = newItem;
            NotifyOfPropertyChange("ActiveItem");
            OnActivationProcessed(activeItem, true);
        }
and with my changes:
        protected virtual void ChangeActiveItem(T newItem, bool closePrevious) {
            ScreenExtensions.TryDeactivate(activeItem, closePrevious);

            newItem = EnsureItem(newItem);

            activeItem = newItem;
            NotifyOfPropertyChange("ActiveItem");

            if (IsActive)
                ScreenExtensions.TryActivate(newItem);

            OnActivationProcessed(activeItem, true);
        }
This seems to work. I haven't come across any problems doing this, but I'm curious if anyone knows better than I do what repercussions this change could have.

Thanks!

New Post: Rearranging activation order

New Post: Window Title/DisplayName

$
0
0
I am inheriting from Conductor and setting the DisplayName in the ctor, but resharper is giving the warning 'Virtual member call in constructor'. Other than sealing the class, is there a better way to set this?

New Post: Main Caliburn Window -> How do I get a reference to it

New Post: Pass Property Notification from Child view model to Parent ViewModel in Caliburn Micro

$
0
0
We are using Caliburn Micro and have a parent and child view models. The child view model object is instantiated in the parent view model's constructor and is exposed as a property on ParentViewModel.

ChildViewModel is inherited from PropertyChangedBase. I have a specific property(IsBusy) on childViewModel which when set, I want to notify in a ParentViewModel's event handler, have done following , but the event is not notified in parent view models' handler, please suggest approach or what is problem:

-In Setter of 'IsBusy' property on child view model :

NotifyOfPropertyChange(()=>IsBusy);


-In constructor of ParentViewModel :
ChildViewModel chvm=new ChildViewModel();


-In setter of ChildViewModelProperty on ParentViewModel
private ChildViewModel _childViewModel;

set
{
_childViewModel=value;
_childViewModel.PropertyChanged +=_childViewModel_PropertyChanged </br>
}


-Last Piece for handler
void _childViewModel_PropertyChanged (object sender,PropertyChangedEventargs e){
if (e.PropertyName=="IsBusy")
{
// DO some processing
}
}

-Why NotifyOfPropertyChange() is not able to send property changed notifications to parent view model ? Is this method only for binding ?
•Do I need to use EventAgrregator for this scenario ?? If yes, kindly suggest

New Post: Testing for successful ActivateItem call

$
0
0
I've inherited some code which contains a bug. There is a view model which inherits from Conductor<T>, and the view model for this view contains a listbox - selecting an item from the listbox causes a call to ActivateItem. The activated items implement CanClose.

ActivateItem seems to call CanClose, and ultimately abort if CanClose returns false, but since ActivateItem is a void with no return value, I don't know whether the activation was cancelled and therefore I can't cancel the listbox selection and as such, I end up with a mismatch between the selected item and the details view displayed

This seems like such a fundamentally common requirement that I'm assuming there is a fairly simple way to achieve it - could anybody point me in the right direction?

New Post: Caliburn Micro Conductors calling other conductors

$
0
0
Please suggest some resource/sample to implement following scenario, using Caliburn Micro :

Main Page -Conductor A Main Page has two tabs - Each tab opens two conductors B and C

Conductor B has two screens -Screen 1 and Screen 2

Conductor C has two screens -Screen 3 and Screen 4

Screens 1,2,3,4 publishes events using EventAggergator to Conductor A based on which Conductor A decides to enable/disable the two tabs (activate/deactivate Conductors B and C)

New Post: [WinRT] Navigation not using RootFrame

$
0
0
Hi, I am also trying to make this work, but I can seem to make it work. How do i tell the NavigationService of the "second" frame to navigate in? I can easily make it work without CM, but i want to use CM in my project. Have you managed to make this work, is yoe, would you share some code samples?

New Post: Dynamic view in content control

$
0
0
Hi All,

First of all I am new to Caliburn.Micro. Therefore I am facing some basic issues.
I am developing Single document Interface project in WPF. My ShellView contains Ribbon menu, Content area (ContentControl) and Status bar.
ShellViewModel is responsible to load userControls in ContentControl.

Currently there are 20+ views that can be rendered in ContentControl by any menu item click.
So is there any way that ShellViewModel can dynamically load userControls View model.

I googled this issue, most of the time i found that they have created n-times Content controls in View , and bind it to dedicated property. I think this does not make sense.

New Post: Add [XmlIgnore] to IsNotifying in PropertyChangedBase

$
0
0
unfortunately this doesn't seem to be fixed :(
Viewing all 1760 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>