lecturing one subject with other lecturer's material
In Academia there is always a lot of egos involved. Do not take it personal and let your ego get in the way. As you admit, you are not the main lecturer. He is. He prepared the slides, exercises, exams, practices, final project and so on. Excellent. Less work / stress for you. It is not your time to shine. In any job (academia or not) you must learn how to play "second fiddle" if needed. And this is one of these times.

On the other hand, teaching is much more than the slides, exercises, final project or exams. It is the teacher's personality, how he is in sync with the classroom needs, how to make the students participate in the course and how to make the lesson an unforgettable experience. You can and must try to do all these, regardless of the slides you use. So you can still make all the students want to watch your lecture (instead of his) if that is what it takes to boost your ego. Although it clearly is not a competition. It is just a job. So, do it as best as you can with the tools you are given. It is really that simple.

Update. 

From the comments I see, there is too much focus on "No-one should tell how to teach...". But this is not really the point. If professor B was supposed to teach both lectures and due to a newly assigned duty he cannot, would not that be impolite / inconsiderate for the new professor (Layla) not to give her (at least) the materials and slides he uses? If someone steps in for me, I would most certainly do all the necessary work for my coleague to have the most seamless transition by alleviating some of the stress /work for preparing lectures / slides, exercises. And if I was the subsitute I would appreciate this offer. Why must egos be involved in such a process and why should anyone not accept the offer given? If this situation continues for the next semester - year, Layla should have a saying on how the lecture should be done. But for this year I do not see the point in making too much fuss over it.